"Show changes since your last review" button should still show even if a review was requested from me again #13177

Closed
opened 2025-11-02 10:33:45 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Gr3q on GitHub (Jun 19, 2024).

Description

A PR "Files Changed" tab's "Filter by commit" button's "Show changes since your last review" sub button should still show even if a review was requested from me again after my review. Note that the previous review was not dismissed.

My guess is that the logic only looks at the top of the review stack of a person, and when a request is on top it just skips the part where it works out the difference.

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No, because I need 2 account for that, but I'll do that when I have time.

Log Gist

No response

Screenshots

Before a new review was requested of me

20240619_18h04m14s_grim
20240619_18h04m04s_grim

After a new review was requested of me

20240619_18h07m48s_grim
20240619_18h07m55s_grim

Git Version

No response

Operating System

Ubuntu 22.04

How are you running Gitea?

self-hosted docker image

Database

None

Originally created by @Gr3q on GitHub (Jun 19, 2024). ### Description A PR "Files Changed" tab's "Filter by commit" button's "Show changes since your last review" sub button should still show even if a review was requested from me again after my review. Note that the previous review was not dismissed. My guess is that the logic only looks at the top of the review stack of a person, and when a request is on top it just skips the part where it works out the difference. ### Gitea Version 1.21.11 ### Can you reproduce the bug on the Gitea demo site? No, because I need 2 account for that, but I'll do that when I have time. ### Log Gist _No response_ ### Screenshots #### Before a new review was requested of me ![20240619_18h04m14s_grim](https://github.com/go-gitea/gitea/assets/22377521/bcd8d39f-1d43-40e5-ab2e-5d28e71e7d1c) ![20240619_18h04m04s_grim](https://github.com/go-gitea/gitea/assets/22377521/7191d00b-99c6-437d-b77d-275d02ca5f92) #### After a new review was requested of me ![20240619_18h07m48s_grim](https://github.com/go-gitea/gitea/assets/22377521/dc63b379-1e30-47d0-be83-dee67cd4048e) ![20240619_18h07m55s_grim](https://github.com/go-gitea/gitea/assets/22377521/6fc8635c-01aa-4afe-8c0a-dc9b7e1f816d) ### Git Version _No response_ ### Operating System Ubuntu 22.04 ### How are you running Gitea? self-hosted docker image ### Database None
GiteaMirror added the type/bug label 2025-11-02 10:33:45 -06:00
Author
Owner

@Zettat123 commented on GitHub (Sep 26, 2024):

Your guess is correct. A review request is a special type of review.
3269b04d61/models/issues/review.go (L101-L102)

When we create a review request, we do not need to specify the commit ID.
3269b04d61/models/issues/review.go (L692-L698)

Therefore, when the latest review is a review request, the commit ID will be empty, which will cause the "Show changes since your last review" button to not show.

To fix this issue, I think we should improve the logic of querying the latest review. In this case, we should try to get the latest review whose commit ID is not empty.

@Zettat123 commented on GitHub (Sep 26, 2024): Your guess is correct. A review request is a special type of review. https://github.com/go-gitea/gitea/blob/3269b04d61ffe6a7ce462cd05ee150e4491124e8/models/issues/review.go#L101-L102 When we create a review request, we do not need to specify the commit ID. https://github.com/go-gitea/gitea/blob/3269b04d61ffe6a7ce462cd05ee150e4491124e8/models/issues/review.go#L692-L698 Therefore, when the latest review is a review request, the commit ID will be empty, which will cause the "Show changes since your last review" button to not show. To fix this issue, I think we should improve the logic of querying the latest review. In this case, we should try to get the latest review whose commit ID is not empty.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13177