You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6b76027
Browse filesBrowse the repository at this point in the historyBrowse files
fix(webview): reset isViewLaunched when the renderer is replaced
isViewLaunched was written twice in production: initialised false and set true by the
webviewDidLaunch handler. Nothing lowered it. Replacing the view (clearWebviewResources runs for a
new view, a disposed sidebar view and clearAllTasks) and replacing the renderer in place
(reloadWebviewForRecovery assigns new HTML) both discard the document that held the message
listener, yet the provider kept believing a post could be received. A durable view-state mutation
in that window took the post branch of postViewStateClaimToWebview instead of queueing, and a post
that resolves true against a page with no listener deletes the claim - leaving a durable entry
whose claim no renderer ever received, so the next launch could not adopt this view's state.
clearWebviewResources now lowers the flag for every path that drops the view, and
reloadWebviewForRecovery lowers it before assigning new HTML. The gate itself is unchanged: with
the flag down the queue holds the exact token, and the replacement renderer's own webviewDidLaunch
re-arms the flag and flushes it.
Control (CTRL-2226D): with both resets removed the two new tests fail at the isViewLaunched
expectation immediately after the replacement - the replacement-view save reports claim 'delivered'
and posts into an unlaunched renderer, and the recovery case keeps the flag true after the HTML
swap. The unpatched file was restored byte-identically and core/webview (34 files, 900 tests) and
the launched-flag consumers (activate, extension, api, diagnostics: 28 files, 300 tests) pass on
the fixed tree; eslint --max-warnings=0 on both touched files and src check-types are clean, and
src/eslint-suppressions.json is untouched.
0 commit comments