Skip to content

Replace startup workspace file scan with opened-file telemetry - #5083

Merged
Vidal Ortega (vidorteg) merged 5 commits into
mainfrom
user/vidorteg/update-file-type-telemetry
Nov 2, 2026
Merged

Vidal Ortega (vidorteg) merged 5 commits into
mainfrom
user/vidorteg/update-file-type-telemetry

Conversation

@vidorteg

@vidorteg Vidal Ortega (vidorteg) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4970. On startup the extension scanned the workspace to report telemetry, which could exhaust memory and crash VS Code on large or remote workspaces.

The scan is removed. Instead, the extension listens for files the user opens and counts them by type (each file once, ignoring .git and non-file documents).

Counts are sent in a single batched telemetry event (fileOpened) after 30 seconds of inactivity or when the extension shuts down.This helps to improve and prioritze supported tools based on file format

@vidorteg Vidal Ortega (vidorteg) changed the title User/vidorteg/update file type telemetry Replace startup workspace file scan with opened-file telemetry Oct 30, 2026
@vidorteg

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

…file-type-telemetry

# Conflicts:
#	package-lock.json

Co-authored-by: vidorteg <43078681+vidorteg@users.noreply.github.com>

Copilot AI commented Oct 30, 2026

Copy link
Copy Markdown

Copilot resolve the merge conflicts in this pull request

Resolved in 973a82f by merging main and resolving the lockfile conflicts while preserving opened-file telemetry. Build and all 99 targeted tests passed. Full suite: 185 passed; one favicon-download test failed because external DNS lookups were unavailable.

@vidorteg
Vidal Ortega (vidorteg) marked this pull request as ready for review October 30, 2026 22:08
Copilot AI balanced review requested due to automatic review settings October 30, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The tracker misses documents opened before listener registration, and shutdown reporting can lose pending telemetry because the reporter’s buffered transport is not flushed.

2 open issues
What changed in this PR

Replaces startup workspace scanning with opened-file telemetry to address memory exhaustion and VS Code crashes reported in #4970.

Changes:

  • Counts unique opened files by type, filtering out .git contents and unsupported document schemes.
  • Batches counts after 30 seconds of inactivity and reports pending counts when the tracker is disposed.
  • Updates tests and mocks for event-driven tracking; also downgrades the locked undici dependency.
File Description
test/​utils.test.ts Tests batching, deduplication, filtering, and disposal.
test/​helpers/​helpers.ts Adds document-open and disposable mocks.
test/​extension.test.ts Updates tracker mocks and subscription expectations.
src/​utils.ts Replaces workspace scanning with opened-file tracking.
src/​extension.ts Registers the tracker as an extension subscription.
package-lock.json Downgrades undici from 6.29.1 to 6.28.0.

Review effort: Balanced

Comment thread src/utils.ts Resolved
Comment thread src/utils.ts Resolved

@guangyuexu Guangyue Xu (guangyuexu) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/utils.ts Resolved
Comment thread src/utils.ts Resolved
@vidorteg
Vidal Ortega (vidorteg) merged commit d6cde57 into main Nov 2, 2026
7 checks passed
@vidorteg
Vidal Ortega (vidorteg) deleted the user/vidorteg/update-file-type-telemetry branch November 2, 2026 21:37
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.

Causes VSCode to crash on big projects

4 participants