You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Added testsLink to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.