NuGet / NuGetGallery

NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
https://www.nuget.org/
Apache License 2.0
1.52k stars 644 forks source link

[NuGet.org Bug]: Search parameter `tfms=net` lights up the .NET framework generation checkbox #9846

Open advay26 opened 4 months ago

advay26 commented 4 months ago

Impact

It bothers me. A fix would be nice

Describe the bug

When you search on nuget.org using the tfms=net parameter, the .NET framework checkbox is shown as selected. This should not be selected.

The .NET framework generation checkbox should only be selected if frameworks=net is in the URL. tfms=net refers to the version-less '.NET Framework' (not '.NET') TFM, not a framework generation.

Repro Steps

  1. Go to https://www.nuget.org/packages?q=&tfms=net
  2. The .NET framework generation checkbox is selected in the filter panel, even though there is no frameworks=net parameter.

Expected Behavior

None of the checkboxes should be selected in this case.

tfms=net refers to the version-less .NET Framework TFM (shortname = 'net'), not the .NET 5+ framework generation. The js code in https://github.com/NuGet/NuGetGallery/blob/main/src/NuGetGallery/Scripts/gallery/page-list-packages.js#L177 does not distinguish between frameworks= and tfms= parameters properly, and needs to be fixed.

Screenshots

No response

Additional Context and logs

No response

Nirmal4G commented 3 weeks ago

Impact

It bothers me.

Golden! 😂😎