Skip to content

Flush final task markers before completion notification - #339551

Merged
Megan Rogge (meganrogge) merged 2 commits into
microsoft:mainfrom
rksharma-owg:codex/task-final-diagnostic-delivery
Nov 5, 2026
Merged

Megan Rogge (meganrogge) merged 2 commits into
microsoft:mainfrom
rksharma-owg:codex/task-final-diagnostic-delivery

Conversation

@rksharma-owg

Copy link
Copy Markdown
Contributor

Fixes #339547

Background task completion reads MarkerService for onDidFindErrors before flushing the current resource. The resulting snapshot is empty for a one-file cycle and incomplete for a multi-file cycle. Flush the current resource before reading and notifying consumers.

Regression tests use the real MarkerService and collector, checking one-file and two-file snapshots over repeated cycles and cleanup after an empty cycle. The completion snapshot tests fail against the original implementation. Existing end-event ordering and marker-delivery guards remain in place.

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. All 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:52

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 focused fix preserves event ordering and is covered by representative regression tests.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes background task completion snapshots by publishing the final resource’s markers before notifying consumers.

Changes:

  • Flushes pending markers before onDidFindErrors.
  • Adds regression coverage for repeated one-file, two-file, and empty cycles.
File Description
problemCollectors.ts Flushes final-resource markers before completion notification.
problemCollectors.test.ts Verifies complete snapshots and marker cleanup.

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

@meganrogge Megan Rogge (meganrogge) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix!

@meganrogge
Megan Rogge (meganrogge) enabled auto-merge (squash) November 3, 2026 19:30
@meganrogge
Megan Rogge (meganrogge) merged commit 37a8101 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

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.

🟡 Changes recommended

Flushing on inactive matchers’ end patterns can suppress later diagnostic updates on Windows, leaving truncated messages in the Problems panel and completion snapshot.

1 open issue

Review effort: Max

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.

Background task completion error event omits the final resource

5 participants