oficina / mapa Public

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>
Paul Campbell pushed by paul@keymail.dev 9db58d6524a0e0f0424442bb992127ab4ca34ee4 parent 63ffda6
7 files changed, +125 −36
  • editor/page.mjs +3 −14
  • editor/post.mjs +34 −0
  • editor/post.test.mjs +26 −0
  • editor/saver.mjs +23 −0
  • editor/saver.test.mjs +17 −0
  • internal/mapa/credits/assets.json +1 −1
  • internal/mapa/static/{editor.b58b8b98fc20e4b7.js => editor.1969c5f18c953d0a.js} +21 −21
editor/page.mjs

Loading diff…

editor/post.mjs

Loading diff…

editor/post.test.mjs

Loading diff…

editor/saver.mjs

Loading diff…

editor/saver.test.mjs

Loading diff…

internal/mapa/credits/assets.json

Loading diff…

internal/mapa/static/{editor.b58b8b98fc20e4b7.js => editor.1969c5f18c953d0a.js}

Loading diff…