Skip to content

Only track server-created work done progress reporters - #1907

Merged
Dirk Bäumer (dbaeumer) merged 1 commit into
microsoft:mainfrom
trivikr:server-reporter-work-done
Oct 22, 2026
Merged

Dirk Bäumer (dbaeumer) merged 1 commit into
microsoft:mainfrom
trivikr:server-reporter-work-done

Conversation

@trivikr

Copy link
Copy Markdown
Contributor

Fixes: #1906

WorkDoneProgressReporterImpl kept every reporter in a static Instances map until done(), so handlers that ignore their reporter leaked one entry per request carrying a client workDoneToken.

  • Move Instances to WorkDoneProgressServerReporterImpl; only reporters from createWorkDoneProgress() can be cancelled via window/workDoneProgress/cancel, so only those are tracked.
  • Drop the unreachable NullProgressServerReporter check in the cancel handler.

WorkDoneProgressReporterImpl added every reporter to a static Instances
map, including those attached to client-provided workDoneTokens, and
removed it only in done(). Handlers that never call done() leaked one
entry per request carrying a workDoneToken.

Only reporters from createWorkDoneProgress() can be cancelled via
window/workDoneProgress/cancel, so move the map to
WorkDoneProgressServerReporterImpl. Also drop the unreachable
NullProgressServerReporter check in the cancel handler; those
reporters were never in the map.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 04:35

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.

🟢 Approval recommended

The focused change removes the reported retention path while preserving progress delivery and server-created reporter cancellation.

No open issues 🎉

What changed in this PR

Fixes #1906 by preventing request-associated work done progress reporters from being retained when handlers omit done().

Changes:

  • Track only server-created reporters, preserving their cancellation and cleanup behavior.
  • Simplify cancellation handling by removing the unreachable null-reporter check.
File Description
server/​src/​common/​progress.ts Moves reporter tracking to the server-created subclass and updates cancellation lookup.

Review effort: Balanced

@dbaeumer
Dirk Bäumer (dbaeumer) merged commit d47b715 into microsoft:main Oct 22, 2026
5 checks passed
@dbaeumer Dirk Bäumer (dbaeumer) added this to the 3.18.6 milestone Oct 22, 2026
@trivikr
Trivikram Kamat (trivikr) deleted the server-reporter-work-done branch October 26, 2026 19:09
@dbaeumer Dirk Bäumer (dbaeumer) added this to the 3.18.6 milestone Nov 19, 2026
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.

server: work done reporters for client-provided tokens are never released if done() isn't called

5 participants