fix(ceremony): wait for the pinned Worker after register() resolves - #103
Merged
Merged
Conversation
WebKit, and apparently Firefox, can resolve register() for a changed script before the registration shows the Worker it installs. Prefetch then found no pinned Worker and failed with "Missing build-pinned Service Worker" before OAuth. That's what the Worker-transition e2e caught under CI load (#101), and returning Safari users can hit it too. Prefetch now waits for the pinned Worker within the same 15-second bound, on updatefound or by sampling the registration, and only then for its installation. Refs #101 Signed-off-by: Wondertan <hlibwondertan@gmail.com> Assisted-by: Claude Opus 5.5
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.
Fixes #101. WebKit (
ios-emulatedin run 37045969361) failed the Worker-transition e2e withMissing build-pinned Service Worker, which #98's diagnostic surfaced.register()for a changed script resolved before the registration showed the Worker it installs, andregisterRootWorkerfailed at once.Prefetch now waits for the pinned Worker within the existing 15-second bound, on
updatefoundor by sampling the registration's slots, and only then for its installation. A pinned Worker that never appears still fails with the same message once the bound passes.Tests: two new unit cases (the Worker appears via
updatefoundand via sampling) fail without the fix. The existing rejection cases now run under fake timers. Ceremony unit tests: 996 passed. The race doesn't reproduce locally, so CI's browser jobs are the real check.