Skip to content

[Routine - VT] fix(extension): dispose treeView listeners and pending reveal timer#77

Draft
winterdrive wants to merge 1 commit into
mainfrom
routine/vt-fix-treeview-listener-disposal-260702
Draft

[Routine - VT] fix(extension): dispose treeView listeners and pending reveal timer#77
winterdrive wants to merge 1 commit into
mainfrom
routine/vt-fix-treeview-listener-disposal-260702

Conversation

@winterdrive

Copy link
Copy Markdown
Owner

1. Pre-flight Check

Open PRs at the time of this run:

  • chore: release v0.7.6 #76 chore: release v0.7.6 (release/0.7.6-260701main, not draft) — touches only CHANGELOG.md, package.json, package-lock.json.

Active/remote branches inspected: various origin/routine/vt-fix-* branches (all already merged into main, confirmed via git log --all), plus unrelated fork branches (Ferezoz/*, jianfulin/*) not touching this repo's open PR set.

This PR only changes src/extension.ts (treeView listener registration and a debounce-timer disposal), which does not overlap with PR #76's release-metadata-only diff or any other active branch.

2. Changes

  • Wrapped treeView.onDidExpandElement, treeView.onDidCollapseElement, treeView.onDidChangeVisibility, and the first treeView.onDidChangeSelection listener registrations in context.subscriptions.push(...) so they are explicitly disposed on extension deactivation (previously only a second, duplicate onDidChangeSelection listener was disposed).
  • Registered a disposable that clears the debounced revealTimeout (setTimeout) used for auto-revealing the active file, so a pending timer callback cannot fire against an already-disposed treeView after deactivation.

Confirmed this PR does not:

  • Add/remove/rename any VS Code command registrations.
  • Add/remove/rename any contributed configuration keys in package.json.
  • Modify dependencies or package.json/package-lock.json.
  • Touch tab-group serialization or config storage format.

3. Safety Verification

Commands run locally, all passed:

  • npx tsc -p ./ → passed, no errors.
  • npm run test (runs tsc -p ./ && jest --runInBand) → 25 suites / 175 tests passed.

No lint or format:check script exists in package.json, so those steps were skipped per the routine-task instructions.

4. CI / Release Gate Note

This is a daily routine Draft PR. Package version bump and CHANGELOG.md updates are intentionally deferred to the weekend release/integration PR. If CI fails solely due to the repository's release-readiness/version-bump gate, that is expected behavior for a routine PR, not a code validation failure.

onDidExpandElement, onDidCollapseElement, onDidChangeVisibility, and the
first onDidChangeSelection listener were registered without being added to
context.subscriptions, so they were never explicitly disposed. Also clear
the debounced reveal setTimeout on deactivation so it can't fire against a
disposed treeView.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant