Editor: a hung POST times out, and a landed one is known as its own
Fable's re-review of 14ab6a6, L3. post() had no timeout, so one hung autosave held inflight and every later autosave waited behind it, the status stuck at Saving. post.mjs aborts a request after 10 seconds (never a keepalive one); the saver takes that as offline and retries. An aborted request may have landed. Every draft write is version-checked, so the retry meets a 409 whose body is the text that request sent. The saver now recognises it as its own: it takes that version and autosaves the typing since, where before stale() replaced the typing with it and called the draft another tab's. Gates: post.test.mjs (a hanging POST rejects within the timeout; a keepalive carries no signal); a saver.test.mjs case, red on the old saver (the typing since was replaced).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 files changed,
+125
−36
editor/page.mjs+3 −14editor/post.mjs+34 −0editor/post.test.mjs+26 −0editor/saver.mjs+23 −0editor/saver.test.mjs+17 −0internal/mapa/credits/assets.json+1 −1internal/mapa/static/{editor.b58b8b98fc20e4b7.js => editor.1969c5f18c953d0a.js}+21 −21
editor/page.mjsLoading diff…
editor/post.mjsLoading diff…
editor/post.test.mjsLoading diff…
editor/saver.mjsLoading diff…
editor/saver.test.mjsLoading diff…
internal/mapa/credits/assets.jsonLoading diff…
internal/mapa/static/{editor.b58b8b98fc20e4b7.js => editor.1969c5f18c953d0a.js}Loading diff…