Skip to content

Fix progress notification ordering in GetProjectStatsAsync#55

Closed
Copilot wants to merge 2 commits into012-mcp-integration-primitivesfrom
copilot/sub-pr-52-another-one
Closed

Fix progress notification ordering in GetProjectStatsAsync#55
Copilot wants to merge 2 commits into012-mcp-integration-primitivesfrom
copilot/sub-pr-52-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

Progress stage 2/3 notifications were emitted after their respective slow operations completed, meaning clients only saw updates once the work was already done.

Changes

  • Stage 2 ("Computing dependency metrics") moved to before ComputeStatsAsync
  • Stage 3 ("Summarizing results") moved to before JSON serialization and cache storage
// Before: notifications fired after the slow work
var stats = await statsService.ComputeStatsAsync(...);
progress?.Report(new ProgressNotificationValue { Progress = 2, ... }); // too late

// After: notifications fire before the slow work
progress?.Report(new ProgressNotificationValue { Progress = 2, ... });
var stats = await statsService.ComputeStatsAsync(...);

progress?.Report(new ProgressNotificationValue { Progress = 3, ... });
var json = JsonSerializer.Serialize(stats);
await cache.StoreAsync(...);

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ations

Co-authored-by: HandyS11 <62420910+HandyS11@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP: Address feedback on mcp integration primitives PR Fix progress notification ordering in GetProjectStatsAsync Mar 11, 2026
@HandyS11 HandyS11 marked this pull request as ready for review March 11, 2026 12:24
Copilot AI review requested due to automatic review settings March 11, 2026 12:24
@HandyS11 HandyS11 closed this Mar 11, 2026
@HandyS11 HandyS11 deleted the copilot/sub-pr-52-another-one branch March 11, 2026 12:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes progress notification timing in the MCP tool get_project_stats so clients receive stage updates before the corresponding slow operations run.

Changes:

  • Emit progress stage 2 (“Computing dependency metrics”) before ComputeStatsAsync.
  • Emit progress stage 3 (“Summarizing results”) before JSON serialization and cache storage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants