fix: Undisposed FileSystemWatcher in WorkspaceTracker (WorkspaceTracker_45) #4236
Labels
bug
Something isn't working
Issue - In Progress
Someone is actively working on this. Should link to a PR soon.
name: Bug Report
description: Undisposed FileSystemWatcher in WorkspaceTracker
labels: ["bug", "memory-leak", "guaranteed", "integrations", "auto-generated"]
Thanks for your report! Please check existing issues first:
👉 https://github.com/RooCodeInc/Roo-Code/issues
App Version
N/A (Static Analysis - Detected in WorkspaceTracker_45)
API Provider
Not Applicable / Other
Model Used
N/A (Core Extension Service - WorkspaceTracker)
🔁 Steps to Reproduce
WorkspaceTracker
instance is created (typically byClineProvider
).WorkspaceTracker
constructor callsregisterListeners
, which creates avscode.workspace.createFileSystemWatcher("**")
and adds it to an internaldisposables
array.WorkspaceTracker
instance is later disposed of (e.g., when its owningClineProvider
is disposed).WorkspaceTracker.dispose()
method is called.dispose
method only clearsupdateTimer
andresetTimer
. It does not iterate through thedisposables
array to calldispose()
on theFileSystemWatcher
.FileSystemWatcher
remains active, listening to all file events in the workspace, even though theWorkspaceTracker
is no longer in use.💥 Outcome Summary
Expected the
FileSystemWatcher
created byWorkspaceTracker
to be disposed of when theWorkspaceTracker
instance itself is disposed. However, thedispose
method is incomplete, leading to the watcher leaking and continuing to consume resources.📄 Relevant Logs or Errors (Optional)
Summary from
leak-report/guaranteed/WorkspaceTracker_45.md
:The issue is in
src/integrations/workspace/WorkspaceTracker.ts
where thedispose
method does not clean up all disposables.The text was updated successfully, but these errors were encountered: