Skip to content

Preserve distinct task errors from the same resource - #339550

Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
rksharma-owg:codex/task-diagnostic-identity
Nov 5, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
rksharma-owg:codex/task-diagnostic-identity

Conversation

@rksharma-owg

Copy link
Copy Markdown
Contributor

Fixes #339546

TaskProblemMonitor previously keyed its per-owner marker map by resource URI, so one error overwrote another error in the same file. Use the URI together with IMarkerData.makeKey() to retain distinct errors and keep their resource associations correct. Identical markers remain deduplicated.

Regression tests cover same-file and different-file errors, duplicate messages and owners, replacing a completed cycle, ignoring warnings, invalidation, and terminal disposal. The same-file tests fail against the original implementation.

Validation: local Chromium/WebKit/Electron tests, client type checking and transpilation, scoped hygiene and ESLint. Fork preflight checks the exact contribution commit on Linux, Windows, and macOS with browser/Electron task suites, same-runner baseline controls, source-quality checks, and JavaScript/TypeScript CodeQL. The five existing task build-selection tests remain pending; Linux also skips the existing Bug 19548 case. Applicable preflight jobs passed for this exact contribution commit. Broad upstream CI and maintainer approval remain separate.

Copilot AI balanced review requested due to automatic review settings October 4, 2026 02:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation matches the reported issue and is covered by focused regression tests.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes task diagnostics dropping distinct same-file errors by using a composite marker identity.

Changes:

  • Keys markers by resource URI and marker identity.
  • Adds regression coverage for deduplication, lifecycle, filtering, and resource association.
  • No actionable issues found.
File Description
taskProblemMonitor.ts Preserves distinct markers per resource.
taskProblemMonitor.test.ts Adds focused regression tests.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@meganrogge

Copy link
Copy Markdown
Collaborator

Dmitriy Vasyura (@dmitrivMS) handing this one to you along with the other task PRs. The fix looks right to me. One nit: the test reads the private terminalDisposables via Reflect.get because TaskProblemMonitor never registers that DisposableMap; wrapping it in this._register(...) in production would fix the leak and let the test drop the Reflect call.

@dmitrivMS Dmitriy Vasyura (dmitrivMS) added the tasks Task system issues label Nov 3, 2026
Register the terminal disposable map with the monitor and remove the test's private-field cleanup workaround. Add regression coverage for listener removal when the monitor is disposed.

Co-authored-by: Copilot <[email protected]>
@dmitrivMS

Copy link
Copy Markdown
Collaborator

RKS (@rksharma-owg) Thank you!

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 66501d4 into microsoft:main Nov 5, 2026
59 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tasks Task system issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task problem monitor drops distinct errors on the same file

6 participants