Repository navigation
fix(webview): bound worker updates and acquire the expected controller - #8074
Open
NevermoreN wants to merge 1 commit into
Open
NevermoreN wants to merge 1 commit into
NevermoreN wants to merge 1 commit into
Conversation
Reuse matching registrations, bound update waits, validate claim requests, and cover worker lifecycle behavior in Chromium. Fixes coder#8073
This branch has not been deployed
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 #8073
When a root PWA worker controls a new webview, the bootstrap treats it as an existing webview controller and awaits another update job. That job can hold initialization beyond extension renderer deadlines even after the correct webview worker takes control. Reopening a webview can also queue
register()behind a previous update.This change reuses a registration only when its exact scope and full active script URL match, bounds its explicit update wait to three seconds, and requires the expected controller before content initialization. Initial registration is still required. Controller acquisition fails after ten seconds and removes its listeners and retry timer. Update failure can fall back only to the matching active worker. A distinct worker query parameter prevents reusing a pre-fix worker that lacks the claim handler.
The worker accepts a claim request only from a window client on the same origin at an exact outer-webview path. The patch preserves the third-party-cookie diagnostic and updates the CSP hash without relaxing the policy.
Validation:
This PR does not include the deployment's Codex preload suppression or module cache. It does not claim to fix the separate extension main-thread stall, guarantee sub-30-second cold startup, or bound first registration. A full code-server build and whole-workbench extension interaction have not been run for this PR. The deployed combined-workaround timings in the issue are prior diagnostic evidence, not validation of this source patch.