Incorrect viewed files counter in huge PRs #15076

Open
opened 2025-11-02 11:29:36 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @didim99 on GitHub (Oct 31, 2025).

Description

If you have a huge PR that contains large number of files, more than default limit of review page (e.g. for projects based on Unity 3D game engine), file counter of viewed files on "Files" page shows incorrect value on page load. For example, if you have limit per page is 100 files and you marked 118 of 130 files from PR as viewed then reloaded code review page, the file counter tells you "88/130" instead of "118/130" because remaining 30 files is not loaded to page (you need to click "load more" button to see the actual number of files).

This behaviour is very confusing when you reviewing a huge PRs!

Steps to reproduce:

  1. Login to demo.gitea.com
  2. Open this PR in my test repo: https://demo.gitea.com/didim99/test/pulls/4/files
  3. Click "load more" to see all files
  4. Mark some random files as viewed
  5. Reload page

Gitea Version

1.26.0+dev-91-g39c08ce4c1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Before "load more":
Image

After "load more":
Image

Git Version

Not matters

Operating System

Not matters

How are you running Gitea?

Using demo.gitea.com

Database

None

Originally created by @didim99 on GitHub (Oct 31, 2025). ### Description If you have a huge PR that contains large number of files, more than default limit of review page (e.g. for projects based on Unity 3D game engine), file counter of viewed files on "Files" page shows incorrect value on page load. For example, if you have limit per page is 100 files and you marked 118 of 130 files from PR as viewed then reloaded code review page, the file counter tells you "88/130" instead of "118/130" because remaining 30 files is not loaded to page (you need to click "load more" button to see the actual number of files). This behaviour is very confusing when you reviewing a huge PRs! Steps to reproduce: 1. Login to demo.gitea.com 2. Open this PR in my test repo: https://demo.gitea.com/didim99/test/pulls/4/files 3. Click "load more" to see all files 4. Mark some random files as viewed 5. Reload page ### Gitea Version 1.26.0+dev-91-g39c08ce4c1 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots Before "load more": <img width="1835" height="389" alt="Image" src="https://github.com/user-attachments/assets/94fa54be-94be-4bc8-b021-fb1700e48e30" /> After "load more": <img width="1838" height="410" alt="Image" src="https://github.com/user-attachments/assets/43ccfea1-7e23-4701-a758-730568fbe86f" /> ### Git Version Not matters ### Operating System Not matters ### How are you running Gitea? Using demo.gitea.com ### Database None
GiteaMirror added the type/bug label 2025-11-02 11:29:36 -06:00
Author
Owner

@lunny commented on GitHub (Nov 2, 2025):

So that the reviewed number should not be loaded from the frontend at the first time, it should be read from database for the first time loading.

@lunny commented on GitHub (Nov 2, 2025): So that the reviewed number should not be loaded from the frontend at the first time, it should be read from database for the first time loading.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15076