Skip to content

Coordinate Project Nominations to prevent endless refresh loop in PM UI - #7685

Merged
donnie-msft merged 6 commits into
devfrom
dev-donnie-msft-pmuiNominations
Sep 19, 2026
Merged

donnie-msft merged 6 commits into
devfrom
dev-donnie-msft-pmuiNominations

Conversation

@donnie-msft

@donnie-msft donnie-msft commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#15072

Developer Community ticket https://developercommunity.visualstudio.com/t/Manage-Nuget-Packages-for-Solution-crash/11032673

Description

Fixes an endless Package Manager UI refresh loop when updating a package across many projects in a solution that uses Central Package Management (CPM).

Record the stopwatch duration while waiting on nominations and emit in telemetry so we can understand how often this fix is used to address the problem, and to what extent.

Problem

The PM UI refreshes in response to project nominations.
With CPM, the rate of these nominations is much higher as a shared file (Directory.Packages.props) is updated.
Project System renominates every project.

In my testing this resulted in 2 minutes of "Loading..." refreshing (at which point I closed VS) and it "flickered" repeatedly during that time.
That indicates PM UI was responding to the event and starting a new "refresh" repeatedly.

Copilot calls the cycle of "Operation canceled by user" / "Loading..." flickering a "refresh storm".

Fix

Before refreshing, wait for the in-flight project nominations to settle.

  • A new ProjectNominationCoordinator mirrors SolutionRestoreWorker's bulk-restore coordination
    • Enumerates the project restore info sources and awaits IVsProjectRestoreInfoSource.WhenNominated for any source reporting HasPendingNomination
    • Re-scans until a clean pass
    • Finally, performs a single refresh of PM UI
  • Loading progress indicator now stays on without flickering
  • The refresh now happens in about 5 seconds (down from 2 minutes to infinity!) and the package list appears cleanly.

Restore's bulk-restore

This fix is inspired by Restore's bulk-restore.

Before a bulk restore, SolutionRestoreWorker waits for all projects with pending nominations to finish (HasPendingNomination / WhenNominated)

It's bounded by a 5-minute BulkRestoreCoordinationTimeout so a crashed/stuck project system can't hang it.
On timeout, it proceeds with whatever was nominated.

ProjectNominationCoordinator uses the same signal and the same 5-minute timeout at the PM UI, with the same graceful degradation.

Validation

  • New unit tests for ProjectNominationCoordinator tests the ability to settle, timeout, progress guards, project-scoped wait, and the effect of cancellation.

  • Manual end-to-end repro on OrchardCore (large CPM solution), updating Microsoft.Extensions.Azure from 1.14.0 to 1.14.1 across 9 projects:

Results with large CPM solution (OrchardCore)

Baseline (shipping NuGet) Fixed (this PR)
PM UI refresh 100+ "Loading…" refreshes, never settles ❌ Settled in ~5s, one steady "Loading…" ✅
Install pipeline 9 projects, ~8s 9 projects, ~8s (identical)
Package / version Microsoft.Extensions.Azure 1.14.0 → 1.14.1 same
Projects updated ~9 referencing the package same

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@donnie-msft
donnie-msft force-pushed the dev-donnie-msft-pmuiNominations branch from 5e31ea3 to e9a994b Compare September 4, 2026 00:24
@donnie-msft
donnie-msft marked this pull request as ready for review September 4, 2026 00:25
@donnie-msft
donnie-msft requested a review from a team as a code owner September 4, 2026 00:25

@jebriede jebriede 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.

Looks good! One change requested to ensure CTS disposal.

@donnie-msft
donnie-msft requested a review from jebriede September 8, 2026 21:55

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't batch the nominations. Just do it one by one. More perf efficient and it much shorter code.

jebriede
jebriede previously approved these changes Sep 11, 2026
Nigusu-Allehu
Nigusu-Allehu previously approved these changes Sep 15, 2026
@donnie-msft
donnie-msft requested a review from zivkan September 17, 2026 16:58
@donnie-msft
donnie-msft force-pushed the dev-donnie-msft-pmuiNominations branch from 16904d7 to c8cb4d1 Compare September 17, 2026 17:00
@donnie-msft
donnie-msft merged commit e54f375 into dev Sep 19, 2026
18 checks passed
@donnie-msft
donnie-msft deleted the dev-donnie-msft-pmuiNominations branch September 19, 2026 00:07
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.

Updating packages in Solution PM UI with CPM causes endless refresh loop

5 participants