fix(web-studio): normalize service worker scope - #3963
Open
ranxi2001 wants to merge 1 commit into
Open
Conversation
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.
Description
Studio reused its slashless router base path as the service worker scope. In
the standard
/studio/deployment, browsers therefore rejected/studio/service-worker.jswith scope/studio, and the rejected registrationpromise was left unhandled.
This change derives a dedicated slash-terminated scope for service worker
registration while leaving the router base path unchanged. Registration
failures are caught and logged with context.
Human Involvement
Related Issue
Fixes #3959
Type of Change
Changes Made
Testing
Commands run:
The production
/studio/bundle was also exercised in Playwright Chromium. Asa control, the old
{ scope: '/studio' }call raised the reportedSecurityError; the patched bundle registered/studio/service-worker.jsatscope
/studio/with no page error.Checklist
Screenshots (if applicable)
Not applicable.
Additional Notes
The repository-wide TypeScript check still reports existing errors in unchanged
source and generated client files. The new helper passes a focused strict
TypeScript check. Repository-wide Prettier also reports three unchanged files;
all files changed by this PR pass Prettier.