Skip to content

Fix auto referenced calculation - remove redundant work #6346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2025

Conversation

nkolev92
Copy link
Member

@nkolev92 nkolev92 commented Mar 24, 2025

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/3205

Description

I think this should address the unneeded looping over the packages.

The bug calls out 3 scenarios for the PackageItemViewModel construction.

One in https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.PackageManagement.UI/PackageItemLoader.cs#L344, which is what I'm fixing here by calculating the AutoReferenced metadata at the same spot the exactly specified version is calculated.

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.PackageManagement.UI/Xamls/InfiniteScrollList.xaml.cs#L615 is called after the PackageCollection.FromPackageReferences which handles the metadata construction correctly.

cc @jebriede

PR Checklist

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

@nkolev92 nkolev92 changed the title Dev nkolev92 fix auto referenced calculation Fix auto referenced calculation - remove redundant work Mar 25, 2025
@nkolev92 nkolev92 marked this pull request as ready for review March 25, 2025 16:20
@nkolev92 nkolev92 requested a review from a team as a code owner March 25, 2025 16:20
Copy link
Contributor

@jebriede jebriede left a comment

Choose a reason for hiding this comment

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

Awesome! Did you have time to validate the fix? If so, please update the description to match that and remove the reference to it being a draft.

@nkolev92
Copy link
Member Author

nkolev92 commented Mar 28, 2025

Yes, I did validate it. I fixed the PR checklist section originally, but not the body

@nkolev92 nkolev92 merged commit bb02493 into dev Mar 28, 2025
23 checks passed
@nkolev92 nkolev92 deleted the dev-nkolev92-fixAutoReferencedCalculation branch March 28, 2025 00:53
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.

6 participants