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
test: remove obsolete editor cache cleanup and its tests - #29485
Stop testing an old editor-close behavior that the app no longer uses. Closing an editor frees its model while keeping bounded view-state caches so reopening can restore the user's position.
What Changed
Remove the unused close wrapper, its cache-deletion functions, the dedicated sweep module and 11 obsolete cache-deletion tests. Keep the model-disposal function the app actually calls and retarget its four existing tests without changing their assertions. The combined-diff reopen test now closes and reopens through the real controller with a cold model registry instead of calling the dead wrapper. Remove its unchecked fixture casts and correct a stale PDF recorder comment.
Why
The app-shell hook calls the model-only controller; none of the removed functions has a production caller. The earlier retention change #21178 deliberately preserved bounded caches, leaving this path behind. Testing it maintained an obsolete alternative behavior. Removing the dead path is clearer than optimizing its sweep or replaying it through mocks. Model lifecycle, attached/reopened ownership, reentrant disposal, bounded cache retention, undo and shell mounting coverage remain.
Linked Issue
Internal test audit; follows the bounded-state retention behavior in #21178.
Visual Proof
N/A — removes unused code and changes tests; application UI and editor-close behavior are unchanged.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Original: seven suites, 53 passed. Candidate: six suites, 42 passed, including a shuffled run (seed104729). Lifecycle18, shell3, view-state-retention9, diff-disposal5 and combined restoration3 remain; four batch model tests remain. Model-only production function and four unchanged keeper suites are byte-identical. Web typecheck, changed-code-quality checks, normal/anti-slop lint, formatting and whitespace checks passed, but another task switched the shared checkout before these final checks. They must be repeated on this exact branch before merge. The six alternating measurement runs finished before that switch and are anchored to the intended base.
A deliberate controller regression erasing combined view state passes the old dead-wrapper test and fails the new cold-controller test on loaded-section equality. A dropped model-disposal batch fails both original and retargeted keeper at the same exact closed-path assertion. All temporary owner mutations restored. These controls also ran after the checkout switch and must be repeated on the exact branch before merge. The cold combined test proves that controller close path plus restoration; it does not claim a model-backed editor widget, the store closeFile command or a network refetch count. Existing real Monaco lifecycle/retention tests and React shell tests remain. Executed on Linux in the background; no native desktop/Windows/macOS run claimed.
Three alternating original-first local pairs, Bun1.4.3 runner with pinned Node24.21 for node-runtime projects, single worker, official module reporter:
Seven original / six retained suites
Original median
Candidate median
Sum of module times
9,354 ms
9,079 ms
Process wall time
11,502 ms
11,141 ms
This is a small local difference, not a whole-PR speed claim. Source-qualified hosted original run38850544014 has 53 passes across five clean reports and 18,506 ms summed official module time. Its Node24.19/Bun1.4.3, Blacksmith X64 four-worker workload differs from local and later main. Candidate CI measurement remains pending; compare the same metric after all five shards are clean and disclose workload/runner drift.
Review
Independent declaration ledger and history/caller pre-review approved the removal and keeper plan. Concrete final preservation review of the recovered commit and exact-branch local reruns remain pending before merge.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
No execution-host, SSH, wire, git-provider or folder-workspace behavior changes. No new production test seam or line-limit exemption. Removes 119 net production lines and 138 net test lines.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Refresh validation: Refreshed onto main 723c258 after #29499 repaired inherited CI failures. All six patch paths retain the approved bytes. Refreshed local six-suite set passes all 42 cases. Independent refresh preservation review approved unchanged controls and keepers. Fresh exact-head run 38866725238 has passed.
Hosted validation: Exact-head full PR run 38866725238 passed, including aggregate PR checks passed and all five clean unit shards. Six retained suites passed all 42 cases, no skips; summed official module cost 17,635 ms versus historical original 18,506 ms across 53 cases. Workloads and broad inputs differ; this does not establish a causal speedup or whole-PR saving.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
📝 Walkthrough
The change removes cache-sweep helpers and closed-tab disposal wrappers. Model disposal remains, and its tests now call disposeClosedEditorModels. The combined-diff restoration test now attaches closed-tab cleanup to a store and checks that cached sections return after the tab is reopened. The PDF view-position disposal comment now describes preventing late recordings from overwriting newer state.
Priority: ⬇️ Low
Merge Risk:⚪ Minimal · up to dbcce
No actionable merge-blocking issue is identified. Repeat the reported checks on the exact branch before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title clearly identifies the main change: removing obsolete editor cache cleanup code and its tests.
Description check
The description is detailed and covers the required sections, including the change, rationale, testing, scope, compatibility considerations, and checklist. It also identifies the related issue and rep…
Full details: Description check
Explanation
The description is detailed and covers the required sections, including the change, rationale, testing, scope, compatibility considerations, and checklist. It also identifies the related issue and reports exact-head hosted validation.
Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
🛠️ Fix failing CI checks: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
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
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.
ELI5
Stop testing an old editor-close behavior that the app no longer uses. Closing an editor frees its model while keeping bounded view-state caches so reopening can restore the user's position.
What Changed
Remove the unused close wrapper, its cache-deletion functions, the dedicated sweep module and 11 obsolete cache-deletion tests. Keep the model-disposal function the app actually calls and retarget its four existing tests without changing their assertions. The combined-diff reopen test now closes and reopens through the real controller with a cold model registry instead of calling the dead wrapper. Remove its unchecked fixture casts and correct a stale PDF recorder comment.
Why
The app-shell hook calls the model-only controller; none of the removed functions has a production caller. The earlier retention change #21178 deliberately preserved bounded caches, leaving this path behind. Testing it maintained an obsolete alternative behavior. Removing the dead path is clearer than optimizing its sweep or replaying it through mocks. Model lifecycle, attached/reopened ownership, reentrant disposal, bounded cache retention, undo and shell mounting coverage remain.
Linked Issue
Internal test audit; follows the bounded-state retention behavior in #21178.
Visual Proof
N/A — removes unused code and changes tests; application UI and editor-close behavior are unchanged.
Testing
Original: seven suites, 53 passed. Candidate: six suites, 42 passed, including a shuffled run (seed104729). Lifecycle18, shell3, view-state-retention9, diff-disposal5 and combined restoration3 remain; four batch model tests remain. Model-only production function and four unchanged keeper suites are byte-identical. Web typecheck, changed-code-quality checks, normal/anti-slop lint, formatting and whitespace checks passed, but another task switched the shared checkout before these final checks. They must be repeated on this exact branch before merge. The six alternating measurement runs finished before that switch and are anchored to the intended base.
A deliberate controller regression erasing combined view state passes the old dead-wrapper test and fails the new cold-controller test on loaded-section equality. A dropped model-disposal batch fails both original and retargeted keeper at the same exact closed-path assertion. All temporary owner mutations restored. These controls also ran after the checkout switch and must be repeated on the exact branch before merge. The cold combined test proves that controller close path plus restoration; it does not claim a model-backed editor widget, the store closeFile command or a network refetch count. Existing real Monaco lifecycle/retention tests and React shell tests remain. Executed on Linux in the background; no native desktop/Windows/macOS run claimed.
Three alternating original-first local pairs, Bun1.4.3 runner with pinned Node24.21 for node-runtime projects, single worker, official module reporter:
This is a small local difference, not a whole-PR speed claim. Source-qualified hosted original run38850544014 has 53 passes across five clean reports and 18,506 ms summed official module time. Its Node24.19/Bun1.4.3, Blacksmith X64 four-worker workload differs from local and later main. Candidate CI measurement remains pending; compare the same metric after all five shards are clean and disclose workload/runner drift.
Review
Independent declaration ledger and history/caller pre-review approved the removal and keeper plan. Concrete final preservation review of the recovered commit and exact-branch local reruns remain pending before merge.
Agent skill upstream boundary
Notes
No execution-host, SSH, wire, git-provider or folder-workspace behavior changes. No new production test seam or line-limit exemption. Removes 119 net production lines and 138 net test lines.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Refresh validation: Refreshed onto main 723c258 after #29499 repaired inherited CI failures. All six patch paths retain the approved bytes. Refreshed local six-suite set passes all 42 cases. Independent refresh preservation review approved unchanged controls and keepers. Fresh exact-head run 38866725238 has passed.
Hosted validation: Exact-head full PR run 38866725238 passed, including aggregate PR checks passed and all five clean unit shards. Six retained suites passed all 42 cases, no skips; summed official module cost 17,635 ms versus historical original 18,506 ms across 53 cases. Workloads and broad inputs differ; this does not establish a causal speedup or whole-PR saving.