Fix warming service worker scripts through preview proxy - #2310
Merged
Conversation
…ebox # Conflicts: # package.json
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.
Summary
Closes #2305
Reproduction and testing
Before this change, a preview upstream returning transient
302responses for/sw.jscauses Chromium registration to reject the script because service-worker scripts cannot be redirected.The regression starts a real Chromium browser, loads the proxied preview, calls
navigator.serviceWorker.register("/sw.js"), and verifies activation after two upstream302responses followed by200. It also verifies the registration headers are not forwarded upstream.Tests run:
npm run buildnpm run test:service-worker-preview-proxynpm run test:browser-callback-materialization-contractsnpm run test:browser-canonical-preview-originnpm run test:browser-actions-environmentnpm run check(the aggregate run reached an existing command-registry failure:wordpress.collect-workload-result outputShape should mention outputSchema id; the 120-second command limit then stopped it)AI assistance
OpenAI gpt-5.6-sol used through OpenCode investigated the proxy and browser behavior, implemented the bounded retry and Chromium coverage, and ran the listed checks. Chris Huber reviewed and remains responsible for every line.