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.54k stars 643 forks source link

[NuGet.org Bug]: Total downloads of packages when viewing profile different depending on browser #9928

Open martin-honnen opened 5 months ago

martin-honnen commented 5 months ago

Impact

It bothers me. A fix would be nice

Describe the bug

I get different results for the number of "Total downloads of packages", depending on the browser (partly, at least). For instance, visiting now with Firefox https://www.nuget.org/profiles/Saxonica it shows "1.419.629", with Chrome it shows "1,397,623". When I do a wget https://www.nuget.org/profiles/Saxonica with WSL Ubuntu and look into the created file for the number it shows 1,402,968. A reload in Firefox or Chrome doesn't show any update of the number.

I don't know whether and where some caching of the number is or the web page is happening but the differences seems odd to me.

Repro Steps

Load e.g. https://www.nuget.org/profiles/Saxonica in different browsers like Chrome or Firefox or with wget, the reported number of Total downloads of packages differs.

Expected Behavior

If I load the same profile in different browser at nearly the same moment I would expect identical numbers for the total downloads of packages.

Screenshots

No response

Additional Context and logs

No response

joelverhagen commented 5 months ago

Hey @martin-honnen, thanks for taking the time to report this. This is a known issue that has come up from time to time in various forms -- sometimes in different pages, other times on the same page.

It's a known issue that we haven't had the time to go resolve. Essentially, our front-end nodes get out of sync with reloading a download count data file (called downloads.v1.json internally). We also have seen some front-end notes completely stop refreshing their cache leading to very stale numbers. As we redeploy the service or nodes are restarted as part of platform maintenance, this issue is mitigated.

Since the nodes refresh independently, we will always have this issue to some extent, but hopefully the delta is small.

This is different from another existing issue https://github.com/NuGet/NuGetGallery/issues/9791 where download counts are coming from two different services (gallery and search).

CC @jodydonetti

jodydonetti commented 5 months ago

Hi all, yes I'm planning on working on this but haven't had the time yet, hopefully soon! Wil update as soon as I'll start digging more into this.