Repository navigation
fix(editor): re-request the frame's document when a worker swap killed it - #228
Merged
Merged
Conversation
…d it main has been red on sw-silent-update since the x2t worker landed, and the trace says what happens: every request 200 except the vendored editor's own iframe document, which ends at status -1, no console error, no onAppReady, and a white screenshot. Activating a Service Worker terminates the outgoing one and fails every request it still had in flight. lib/sw-update.ts covers the swap a page sees as a controllerchange; it cannot cover the one where the page already started under the new controller and the casualty is a request made afterwards. Nothing retries that frame, so the reader is left on a blank page with no way out but a manual reload. The watchdog asks for the document again if the frame has said nothing after 25 s and is empty. There is no editor state to lose -- the editor never started. Once, not forever: a second silence is not a lost request. The window is long on purpose. An aborted navigation and one still in flight look identical from outside (the frame keeps its about:blank document either way), so only time separates them; settleEditor gives the whole boot 90 s, which leaves room for the retried load. Not reproducible locally -- four repeats and 8x CPU throttling all settle in 14 s -- so the decision logic is unit-tested directly and CI is what confirms the rest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MKNHFQ1kek1cHeqhbH37Pk
chaxus
enabled auto-merge (rebase)
September 12, 2026 10:55
Deploying document with
|
| Latest commit: |
6dd8dba
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://02a9d81d.document-7hm.pages.dev |
| Branch Preview URL: | https://fix-blank-editor-frame-watch.document-7hm.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mainhas been red onsw-silent-updatesince #224. The trace from the failing CI job says what happens:onAppReady, white screenshotActivating a Service Worker terminates the outgoing one and fails every request it still had in flight.
lib/sw-update.tscovers the swap a page sees as acontrollerchange; it cannot cover the one where the page already started under the new controller and the casualty is a request made afterwards. Nothing retries that frame, so the reader is left on a blank page with no way out but a manual reload — the exact failure modedocs/explorations/2026-08-23-promotion-without-reload-blank-editor.mddescribes, arriving by a route that mitigation does not see.The watchdog
If the frame has said nothing after 25 s and is empty, ask for its document again. There is no editor state to lose — the editor never started. Once, not forever: a second silence is not a lost request.
The window is long on purpose. An aborted navigation and one still in flight look identical from outside (the frame keeps its
about:blankdocument either way), so only time separates them.settleEditorgives the whole boot 90 s, which leaves room for the retried load.On verification
Not reproducible locally — four repeats of the failing case and an 8× CPU-throttled run all settle in 14 s. So the decision logic is unit-tested directly (5 cases: retries an empty silent frame, stands down on ready, leaves a rendered frame alone, leaves a frame still loading alone, retries once and not forever) and CI is what confirms the rest.
If
sw-silent-updatestill fails after this, the watchdog was not enough and the next step is instrumenting that transition rather than widening timeouts — which is what #227 tried, and it timed out at 180 s too.🤖 Generated with Claude Code
https://claude.ai/code/session_01MKNHFQ1kek1cHeqhbH37Pk