fix(webview): invalidate per-view state after reset and import - #981
fix(webview): invalidate per-view state after reset and import#981easonLiangWorldedtech wants to merge 9 commits into
Conversation
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
247c906 to
ed25707
Compare
ed25707 to
e7512a0
Compare
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Resolve the merge conflicts. The review sequence resumes after the branch is mergeable. Review-state labels are managed by this workflow; do not edit them manually. |
|
Superseded by the vps2 tracking issue easonLiangWorldedtech#41 — content re-cut as F4 (cross-instance reset + import invalidation, single write-queue clear) in the vps2 series; the stale head e7512a0 serves as a porting source only. |
…s import
- ClineProvider: new broadcastResetToAllInstances() clears each live instance's
view-local cache and issues the single global contextProxy setValue("viewStates", undefined)
write (single write-queue clear; no secrets involved, no prune-cap regression).
- resetState: awaits broadcastResetToAllInstances() before the final postStateToWebview
so parallel tabs do not keep stale durable/in-memory per-view state.
- importExport: ImportWithProviderOptions.provider gains optional
broadcastResetToAllInstances?(); importSettingsWithFeedback calls it in a guarded
try/catch (log-only) after a successful import, so a failing broadcast never fails the import.
- importExport spec: 3 new tests (broadcast called when available / skipped when missing /
import result preserved when broadcast throws, console.warn asserted; the skip test also
asserts the broadcast-failure warn is NOT reached). Provider identifiers use
providerIdentifiers.* per the zoo/no-raw-provider-identifiers rule (lint-required
adaptation from Zoo-Code-Org#981's raw-string casts; no semantic change).
- parallelMode spec: appends the CS source-of-record describes (multi-instance isolation,
_clearViewLocalState) — 5 new tests.
- ClineProvider spec: forward fix of the F3 resetState sentinel (F4's global viewStates
clear removes the key; the F3-era toEqual({}) expectation is replaced by toBeUndefined())
plus a new cross-instance resetState test pinning the multi-instance broadcast path
(sibling view-local cache cleared; sibling and caller each post state exactly once).
- webviewMessageHandler.ts was NOT edited: the importSettings case already passes the full
ClineProvider, which structurally satisfies the extended provider type and reaches the real
broadcast method — Zoo-Code-Org#981's structural wrapper hunk is redundant in this stack.
Upstream: Zoo-Code-Org#980 / PR Zoo-Code-Org#981 (vps2 F4)
…s import
- ClineProvider: new broadcastResetToAllInstances() clears each live instance's
view-local cache and issues the single global contextProxy setValue("viewStates", undefined)
write (single write-queue clear; no secrets involved, no prune-cap regression).
- resetState: awaits broadcastResetToAllInstances() before the final postStateToWebview
so parallel tabs do not keep stale durable/in-memory per-view state.
- importExport: ImportWithProviderOptions.provider gains optional
broadcastResetToAllInstances?(); importSettingsWithFeedback calls it in a guarded
try/catch (log-only) after a successful import, so a failing broadcast never fails the import.
- importExport spec: 3 new tests (broadcast called when available / skipped when missing /
import result preserved when broadcast throws, console.warn asserted; the skip test also
asserts the broadcast-failure warn is NOT reached). Provider identifiers use
providerIdentifiers.* per the zoo/no-raw-provider-identifiers rule (lint-required
adaptation from Zoo-Code-Org#981's raw-string casts; no semantic change).
- parallelMode spec: appends the CS source-of-record describes (multi-instance isolation,
_clearViewLocalState) — 5 new tests.
- ClineProvider spec: forward fix of the F3 resetState sentinel (F4's global viewStates
clear removes the key; the F3-era toEqual({}) expectation is replaced by toBeUndefined())
plus a new cross-instance resetState test pinning the multi-instance broadcast path
(sibling view-local cache cleared; sibling and caller each post state exactly once).
- webviewMessageHandler.ts was NOT edited: the importSettings case already passes the full
ClineProvider, which structurally satisfies the extended provider type and reaches the real
broadcast method — Zoo-Code-Org#981's structural wrapper hunk is redundant in this stack.
Upstream: Zoo-Code-Org#980 / PR Zoo-Code-Org#981 (vps2 F4)
…s import
- ClineProvider: new broadcastResetToAllInstances() clears each live instance's
view-local cache and issues the single global contextProxy setValue("viewStates", undefined)
write (single write-queue clear; no secrets involved, no prune-cap regression).
- resetState: awaits broadcastResetToAllInstances() before the final postStateToWebview
so parallel tabs do not keep stale durable/in-memory per-view state.
- importExport: ImportWithProviderOptions.provider gains optional
broadcastResetToAllInstances?(); importSettingsWithFeedback calls it in a guarded
try/catch (log-only) after a successful import, so a failing broadcast never fails the import.
- importExport spec: 3 new tests (broadcast called when available / skipped when missing /
import result preserved when broadcast throws, console.warn asserted; the skip test also
asserts the broadcast-failure warn is NOT reached). Provider identifiers use
providerIdentifiers.* per the zoo/no-raw-provider-identifiers rule (lint-required
adaptation from Zoo-Code-Org#981's raw-string casts; no semantic change).
- parallelMode spec: appends the CS source-of-record describes (multi-instance isolation,
_clearViewLocalState) — 5 new tests.
- ClineProvider spec: forward fix of the F3 resetState sentinel (F4's global viewStates
clear removes the key; the F3-era toEqual({}) expectation is replaced by toBeUndefined())
plus a new cross-instance resetState test pinning the multi-instance broadcast path
(sibling view-local cache cleared; sibling and caller each post state exactly once).
- webviewMessageHandler.ts was NOT edited: the importSettings case already passes the full
ClineProvider, which structurally satisfies the extended provider type and reaches the real
broadcast method — Zoo-Code-Org#981's structural wrapper hunk is redundant in this stack.
Upstream: Zoo-Code-Org#980 / PR Zoo-Code-Org#981 (vps2 F4)
…s import
- ClineProvider: new broadcastResetToAllInstances() clears each live instance's
view-local cache and issues the single global contextProxy setValue("viewStates", undefined)
write (single write-queue clear; no secrets involved, no prune-cap regression).
- resetState: awaits broadcastResetToAllInstances() before the final postStateToWebview
so parallel tabs do not keep stale durable/in-memory per-view state.
- importExport: ImportWithProviderOptions.provider gains optional
broadcastResetToAllInstances?(); importSettingsWithFeedback calls it in a guarded
try/catch (log-only) after a successful import, so a failing broadcast never fails the import.
- importExport spec: 3 new tests (broadcast called when available / skipped when missing /
import result preserved when broadcast throws, console.warn asserted; the skip test also
asserts the broadcast-failure warn is NOT reached). Provider identifiers use
providerIdentifiers.* per the zoo/no-raw-provider-identifiers rule (lint-required
adaptation from Zoo-Code-Org#981's raw-string casts; no semantic change).
- parallelMode spec: appends the CS source-of-record describes (multi-instance isolation,
_clearViewLocalState) — 5 new tests.
- ClineProvider spec: forward fix of the F3 resetState sentinel (F4's global viewStates
clear removes the key; the F3-era toEqual({}) expectation is replaced by toBeUndefined())
plus a new cross-instance resetState test pinning the multi-instance broadcast path
(sibling view-local cache cleared; sibling and caller each post state exactly once).
- webviewMessageHandler.ts was NOT edited: the importSettings case already passes the full
ClineProvider, which structurally satisfies the extended provider type and reaches the real
broadcast method — Zoo-Code-Org#981's structural wrapper hunk is redundant in this stack.
Upstream: Zoo-Code-Org#980 / PR Zoo-Code-Org#981 (vps2 F4)
…s import
- ClineProvider: new broadcastResetToAllInstances() clears each live instance's
view-local cache and issues the single global contextProxy setValue("viewStates", undefined)
write (single write-queue clear; no secrets involved, no prune-cap regression).
- resetState: awaits broadcastResetToAllInstances() before the final postStateToWebview
so parallel tabs do not keep stale durable/in-memory per-view state.
- importExport: ImportWithProviderOptions.provider gains optional
broadcastResetToAllInstances?(); importSettingsWithFeedback calls it in a guarded
try/catch (log-only) after a successful import, so a failing broadcast never fails the import.
- importExport spec: 3 new tests (broadcast called when available / skipped when missing /
import result preserved when broadcast throws, console.warn asserted; the skip test also
asserts the broadcast-failure warn is NOT reached). Provider identifiers use
providerIdentifiers.* per the zoo/no-raw-provider-identifiers rule (lint-required
adaptation from Zoo-Code-Org#981's raw-string casts; no semantic change).
- parallelMode spec: appends the CS source-of-record describes (multi-instance isolation,
_clearViewLocalState) — 5 new tests.
- ClineProvider spec: forward fix of the F3 resetState sentinel (F4's global viewStates
clear removes the key; the F3-era toEqual({}) expectation is replaced by toBeUndefined())
plus a new cross-instance resetState test pinning the multi-instance broadcast path
(sibling view-local cache cleared; sibling and caller each post state exactly once).
- webviewMessageHandler.ts was NOT edited: the importSettings case already passes the full
ClineProvider, which structurally satisfies the extended provider type and reaches the real
broadcast method — Zoo-Code-Org#981's structural wrapper hunk is redundant in this stack.
Upstream: Zoo-Code-Org#980 / PR Zoo-Code-Org#981 (vps2 F4)
…s import
- ClineProvider: new broadcastResetToAllInstances() clears each live instance's
view-local cache and issues the single global contextProxy setValue("viewStates", undefined)
write (single write-queue clear; no secrets involved, no prune-cap regression).
- resetState: awaits broadcastResetToAllInstances() before the final postStateToWebview
so parallel tabs do not keep stale durable/in-memory per-view state.
- importExport: ImportWithProviderOptions.provider gains optional
broadcastResetToAllInstances?(); importSettingsWithFeedback calls it in a guarded
try/catch (log-only) after a successful import, so a failing broadcast never fails the import.
- importExport spec: 3 new tests (broadcast called when available / skipped when missing /
import result preserved when broadcast throws, console.warn asserted; the skip test also
asserts the broadcast-failure warn is NOT reached). Provider identifiers use
providerIdentifiers.* per the zoo/no-raw-provider-identifiers rule (lint-required
adaptation from Zoo-Code-Org#981's raw-string casts; no semantic change).
- parallelMode spec: appends the CS source-of-record describes (multi-instance isolation,
_clearViewLocalState) — 5 new tests.
- ClineProvider spec: forward fix of the F3 resetState sentinel (F4's global viewStates
clear removes the key; the F3-era toEqual({}) expectation is replaced by toBeUndefined())
plus a new cross-instance resetState test pinning the multi-instance broadcast path
(sibling view-local cache cleared; sibling and caller each post state exactly once).
- webviewMessageHandler.ts was NOT edited: the importSettings case already passes the full
ClineProvider, which structurally satisfies the extended provider type and reaches the real
broadcast method — Zoo-Code-Org#981's structural wrapper hunk is redundant in this stack.
Upstream: Zoo-Code-Org#980 / PR Zoo-Code-Org#981 (vps2 F4)
Summary
Invalidate per-view state across all parallel webview instances when a full reset or settings import occurs. This is a sibling follow-up PR that should be reviewed after PR #977 lands.
Blocked until PR #977 (feat/view-local-state-base) lands/rebase.
Changes
broadcastResetToAllInstancesnow clears both in-memory and durable view state for all parallel instancesScope
broadcastResetToAllInstances: clear local + durable view state on resetTests
Related