Repository navigation
fix(editor): drop per-tab watch probe and disk-check generations once superseded or closed - #31128
Conversation
…seded or closed Follow-up to #30415. A watch event that superseded a pending overflow existence probe left the tab's entry behind forever, and the dirty-tab disk-check request map never removed anything. Superseding now deletes the entry, and closed tabs' disk-check requests are dropped by the scan's existing open-tabs subscription. The disk-check map uses a global sequence so a reopened tab can't reuse an old read's number.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
When Orca checks whether an open file still exists after missing file-change events, it keeps a small note per tab so a late answer can be ignored. Some of those notes were never thrown away. This PR throws them away once they can no longer matter.
What Changed
Nothing visible changes for the user; this removes a slow memory leak in the editor.
Why
Deleting a note is the cleanest way to say "ignore the pending answer" once the shared counter already guarantees that old answers can't match. For the disk-check map, the scan already watches the open-tab list, so pruning there reuses a close hook that exists instead of adding a new one. Switching to a shared counter is what makes deleting entries safe.
Linked Issue
Follow-up to #30415.
Visual Proof
N/A: internal bookkeeping only, with no visible or interaction change.
Testing
New tests check that the existence-probe map is empty after a watch event supersedes a pending check, and after a tab closes while its check is pending. A third test checks that the disk-check request map is empty after the tab closes. The existing tests for both modules pass, along with
pnpm lint,oxlint,check:code-quality:changedandpnpm tc.AI Disclosure
Review
Agent skill upstream boundary
Notes
The change runs only in the renderer and only tracks tab ids, so it behaves the same on every platform and for SSH and remote tabs. Pruning walks the small map only when the open-tab list changes and the map is not empty.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)