project-zot / zui

UI for zot registry
Apache License 2.0
12 stars 20 forks source link

[Bug]: ZUI Total Downloads on Image Subpage Not Updating #352

Closed bfreidank closed 8 months ago

bfreidank commented 1 year ago

Describe the bug Main page list of current images updates Downloads count correctly but navigating to specific image sub page shows Total downloads count as 0.

To Reproduce Steps to reproduce the behavior:

  1. Go to zui for zot server with images that have been accessed.
  2. Click on any image in list to navigate to image sub page
  3. Scroll down to Total Downloads located in the right of page showing statistics
  4. See error showing Total downloads as 0

Expected behavior Total downloads update to current total downloads. Alternatively could remove total downloads to specific tag layers page or next to specific tag.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

zainkhanh1892 commented 1 year ago

All images besides machine/bootkit/provision-rootfs, show incorrect image downloads from subpages. However, instead of showing 0 downloads, it showed 4. Either a backend/API issue or a frontend UI issue.

andaaron commented 1 year ago

Hi @zainkhanh1892, can you please clarify what you mean by incorrect?

After the user first uploads an image it should have 0 downloads. That count should increment by 1 every time the user download that image. If you have pre-existing images on an older server, which have been downloaded before, it is normal for that count to be non-zero.

That count should be the total sum of download for all tags in that given repo, at least in current backend implementation. In the backend we have the implementation to get the download counts for individual tags if needed (including per arch).

zainkhanh1892 commented 1 year ago

Yeah of course, Based on my understanding of the error on the main page it shows all the images in the repo, and to the right of it, there are downloads. If I'm looking at c3/ubuntu/openj9-amd64 it says downloads to be 25274 on the main page, but if I click on the subpage total downloads are four. It's the same for a lot of images such as c3/debian/openj9-amd64, which also shows 4 downloads on the subpage whereas, on the main page, it shows 25305 downloads. On the main page the only one with an accurate number of downloads is machine/bootkit/provision-rootfs whereas on the main page and subpage, they match a total of 970 downloads. As I do a more advanced search there are more images that match the total downloads but the ones that don't always show 4 as the number of downloads on the subpage. Either I'm reading the main page downloads wrong or something else. Let me know if that makes more sense!

andaaron commented 1 year ago

I see now you are referring to https://zothub.io/home, this site is running an older deployment:

Some notes:

It does seem to be a backend bug as I checked on a recent build and it is still inconsistent. Looking into it with @laurentiuNiculae.

rchincha commented 8 months ago

@andaaron @laurentiuNiculae close this issue?

andaaron commented 8 months ago

Given the zothub.io version has been updated and includes the fixes, we should close this.