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 4719931
Browse filesBrowse the repository at this point in the historyBrowse files
fix(webview): keep a committed deletion and a live tab panel across failure paths
deleteProviderProfile posted the refreshed state as the last statement inside its
compensated try. postStateToWebview awaits getStateToPostToWebview, which reads custom
modes, task history and auth state, so it can reject after every forward write landed.
That rejection entered the catch and restored the record, the list entry, the selection
and the shared settings while the sibling re-pins and the sticky re-points had already
moved to the survivor: a profile that exists again with conversations still running the
replacement profile, and a caller told the deletion failed. The refresh now runs after
the catch in its own log-only try/catch - the placement the activation block below it
already documents for its own side effects. Stale webview state is repaired by the next
post, a resurrected record is not.
The two rollback cases that used this post as their failure trigger now fail on a step
that sits inside the compensated group whichever way the post is placed - the re-pinned
sibling's own state post - so they keep measuring the rollback instead of the position
of the refresh. The new case pins that a post which rejects after the deletion committed
leaves the record deleted, logs, and keeps the siblings on the survivor.
disposeFailedTabCreation cleared the tracked tab ref to undefined even while another tab
panel was still live, while the disposal path hands the ref to a survivor. Both paths now
use one rule and one pool - live tab-mode provider instances - so a panel that outlives
a failed creation stays reachable to focusInput and to the next ordinary "Open in
editor". It is the same defect the survivor work fixed on the disposal path, seen from
the failed-creation path, which is why there is still only one rule.
Test hygiene: vi.clearAllMocks drops call history but keeps implementations, so the
instance-registry stubs the survivor fixtures install leaked into later tests and made
their results depend on execution order; both describes now reset them in an afterEach
hook, which also runs when a test fails part way through. The sticky-profile case that
left its sibling provider undisposed now runs its deletion in a try/finally that
disposes it, so a live instance no longer stays in ClineProvider static registry.
Controls: with the state post left inside the compensated try, the new provider-profile
case is the only failure (1 of 500) and both retargeted rollback cases pass; with the
survivor hand-back removed from the cleanup path, the new failed-creation case is the
only failure (1 of 70). Restored, both files are green (500 and 70).
Gates: tsc clean, eslint clean with src/eslint-suppressions.json unchanged, prettier
no-op. Full suite 46 failed | 12787 passed | 37 skipped - the same environmental classes
as the parent head: 40 in __tests__/dist_assets.spec.ts (no built dist), 5 in
services/rules/__tests__/rules.spec.ts (Windows symlinks), 0-1 in
api/providers/__tests__/poe.spec.ts. src/core/task/Task.spec.ts is a known inter-run
flake; it did not fail in this run.
Answers #1919 review rows 4476229351, 4477412182, 4477412174 and 4477412186.
0 commit comments