Skip to content

Fix Installed tab freeze from sync-over-async in GetPackageVersionsAsync - #7521

Merged
jebriede merged 1 commit into
devfrom
dev-jebriede-FixInstalledTabSyncOverAsync
Jun 30, 2026
Merged

jebriede merged 1 commit into
devfrom
dev-jebriede-FixInstalledTabSyncOverAsync

Conversation

@jebriede

@jebriede jebriede commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#14964

Description

The PM UI's Installed tab froze for tens of seconds before showing any packages on slow feeds. The root cause is a sync-over-async call in NuGetPackageSearchService.GetPackageVersionsAsync: it read the still-running AllVersionsContextInfo background task via .Result before the method's first await, so the whole call ran synchronously and blocked the caller by roughly one registration round-trip per package. Because the package list view models are built on that thread, the list couldn't render until every package's version load completed.

This change awaits AllVersionsContextInfo once into a local and uses that for the null/count check and the return value, so the method is genuinely asynchronous and yields instead of blocking. The list now renders immediately while version/update info streams in. (It also removes a latent bug where the same ValueTask was consumed two or three times.)

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.

@jebriede
jebriede requested a review from a team as a code owner June 27, 2026 01:30
@martinrrm

Copy link
Copy Markdown
Contributor

I think we also need to add a loader indicator in the version's dropdown, if I understand correctly this will allow items in the scroll list show while we are fetching for the versions.

A quick fix could be making the dropdown disabled with "Loading package versions... " text while NuGetPackageSearchService.GetPackageVersionsAsync ends

@jebriede

jebriede commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor Author

I think we also need to add a loader indicator in the version's dropdown, if I understand correctly this will allow items in the scroll list show while we are fetching for the versions.

A quick fix could be making the dropdown disabled with "Loading package versions... " text while NuGetPackageSearchService.GetPackageVersionsAsync ends

Some indicator that the versions are loading in the UX would be good. Please open an issue for this as a DCR so we can track that improvement.

@jebriede
jebriede merged commit 388049b into dev Jun 30, 2026
20 of 21 checks passed
@jebriede
jebriede deleted the dev-jebriede-FixInstalledTabSyncOverAsync branch June 30, 2026 16:36
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.

Installed packages load all version info before returning, taking a long time to load on slow feeds

5 participants