Slides: saving never stops while a link is loading, and a stop closes the streams
Docs' fix (Docs #94), on the same code. WebKit refuses every ordinary fetch, XHR and Blob read while a link the page opened is loading, so every save read as a failure: "retrying" four times a second, nothing sent. Saves now go keepalive, at most 32KiB and gzipped from 1KB (updatesPost gunzips under the same limits); the unload beacon leaves out a keepalive save on the wire, which shares its 64KiB; the queue resends on pageshow and gives up on an unanswered save; and a save refused with no answer is "retrying" only if /healthz cannot be reached either. On SIGTERM the editor's, the projector's and the share link's streams never ended, because a graceful shutdown cancels no request: an open one held it ten seconds and the process exited 1. Slides drains them on the signal; a stream opened while stopping gets a clean end and a retry delay, so a projector's EventSource reconnects to the next instance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 files changed,
+1,818
−65
AGENTS.md+22 −0cmd/slides/main.go+14 −0cmd/slides/shutdown_test.go+185 −0fixtures/editor-entry.js+53 −23fixtures/engines/saving-webkit.swift+155 −0fixtures/engines/saving.mjs+91 −0fixtures/save-queue.mjs+215 −11fixtures/save-queue.test.mjs+250 −5internal/slides/drain.go+65 −0internal/slides/handlers.go+3 −0internal/slides/live.go+66 −7internal/slides/presentation.go+11 −3internal/slides/static/editor.6401451793bdc579.js+16 −0internal/slides/static/editor.edeb171c568b6ea8.js+0 −16internal/slidestest/drain_test.go+171 −0internal/slidestest/harness_test.go+1 −0internal/slidestest/saving_browser_test.go+500 −0
AGENTS.mdLoading diff…
cmd/slides/main.goLoading diff…
cmd/slides/shutdown_test.goLoading diff…
fixtures/editor-entry.jsLoading diff…
fixtures/engines/saving-webkit.swiftLoading diff…
fixtures/engines/saving.mjsLoading diff…
fixtures/save-queue.mjsLoading diff…
fixtures/save-queue.test.mjsLoading diff…
internal/slides/drain.goLoading diff…
internal/slides/handlers.goLoading diff…
internal/slides/live.goLoading diff…
internal/slides/presentation.goLoading diff…
internal/slides/static/editor.6401451793bdc579.jsLoading diff…
internal/slides/static/editor.edeb171c568b6ea8.jsLoading diff…
internal/slidestest/drain_test.goLoading diff…
internal/slidestest/harness_test.goLoading diff…
internal/slidestest/saving_browser_test.goLoading diff…