Skip to content

fix(ceremony): wait for the pinned Worker after register() resolves - #103

Merged
Wondertan merged 1 commit into
mainfrom
fix/pinned-worker-race
Oct 2, 2026
Merged

Wondertan merged 1 commit into
mainfrom
fix/pinned-worker-race

Conversation

@Wondertan

Copy link
Copy Markdown
Member

Fixes #101. WebKit (ios-emulated in run 37045969361) failed the Worker-transition e2e with Missing build-pinned Service Worker, which #98's diagnostic surfaced. register() for a changed script resolved before the registration showed the Worker it installs, and registerRootWorker failed at once.

Prefetch now waits for the pinned Worker within the existing 15-second bound, on updatefound or 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 updatefound and 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.

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
@Wondertan
Wondertan merged commit 80067c0 into main Oct 2, 2026
14 checks passed
@Wondertan
Wondertan deleted the fix/pinned-worker-race branch October 2, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ceremony e2e: Firefox Worker-transition test occasionally fails fast in Prefetch

1 participant