Off-by-one error in notification page total computation #13673

Closed
opened 2025-11-02 10:49:52 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @colejohnson66 on GitHub (Nov 4, 2024).

Description

There's what appears to be an off-by-one error when computing the number of pages of notifications. In the screenshots below, page 94 contains 16 notifications (out of 20 nominal), yet page 95 still exists (albeit empty).

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

Untested

Log Gist

No response

Screenshots

image

image

Git Version

No response

Operating System

No response

How are you running Gitea?

N/A

Database

None

Originally created by @colejohnson66 on GitHub (Nov 4, 2024). ### Description There's what appears to be an off-by-one error when computing the number of pages of notifications. In the screenshots below, page 94 contains 16 notifications (out of 20 nominal), yet page 95 still exists (albeit empty). ### Gitea Version 1.22.3 ### Can you reproduce the bug on the Gitea demo site? Untested ### Log Gist _No response_ ### Screenshots ![image](https://github.com/user-attachments/assets/347c3df2-0461-4856-bc4c-95a37f6404bc) ![image](https://github.com/user-attachments/assets/7b8894af-2697-4354-8730-57804919123e) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? N/A ### Database None
GiteaMirror added the issue/needs-feedbacktype/bug labels 2025-11-02 10:49:52 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Apr 23, 2025):

If you refresh that page, does the "last empty page" still exist? If no, what you have seen was caused by the "ajax partial reloading", then the page number doesn't match. If yes, then it is a backend bug.

@wxiaoguang commented on GitHub (Apr 23, 2025): If you refresh that page, does the "last empty page" still exist? If no, what you have seen was caused by the "ajax partial reloading", then the page number doesn't match. If yes, then it is a backend bug.
Author
Owner

@colejohnson66 commented on GitHub (Apr 23, 2025):

Issue looks resolved in 1.23.5:

Image

@colejohnson66 commented on GitHub (Apr 23, 2025): Issue looks resolved in 1.23.5: ![Image](https://github.com/user-attachments/assets/492bafff-59e4-4cff-ab12-c1b4714fb9c1)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13673