Deleting the latest comment revision should view previous revision as comment #7963

Closed
opened 2025-11-02 07:42:54 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @qwerty287 on GitHub (Oct 11, 2021).

Gitea Version

1.16.0+dev-345-g24b83ee1e

Git Version

No response

Operating System

No response

How are you running Gitea?

Build from source, from cli

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

If I delete the latest comment revision, the comment will be still the same as the deleted edit. Example: I edit a comment "hello" to "hello world" and delete the "hello world" revision, then it should be "hello", but it's "hello world".

cc @wxiaoguang

Screenshots

https://user-images.githubusercontent.com/80460567/136754079-7b481d14-2102-4f3f-9c35-14b187397b84.mp4

Originally created by @qwerty287 on GitHub (Oct 11, 2021). ### Gitea Version 1.16.0+dev-345-g24b83ee1e ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Build from source, from cli ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Description If I delete the latest comment revision, the comment will be still the same as the deleted edit. Example: I edit a comment "hello" to "hello world" and delete the "hello world" revision, then it should be "hello", but it's "hello world". cc @wxiaoguang ### Screenshots https://user-images.githubusercontent.com/80460567/136754079-7b481d14-2102-4f3f-9c35-14b187397b84.mp4
GiteaMirror added the issue/not-a-bug label 2025-11-02 07:42:54 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Oct 11, 2021):

I think it's not a bug. The comparison is the diff between the revision you clicked and the previous one (by design)

https://github.com/go-gitea/gitea/pull/16909/files#diff-037377fd456709d4b4c433f026ae6308d3f6e6e19803346d287122cd3e57d780R205

https://github.com/go-gitea/gitea/pull/16909/files#diff-b5a5516f3106eb20d94409396e829ab0c2fdf354d01382495984baefe885f75bR130

If you click the first revision, it just shows the first revision. You can think about you are seeing a git commit.

ps: the "Delete" behaivor is a little different from GitHub, GitHub doesn't allow users to delete the latest one, but I think it's not a necessary check, so I didn't follow GitHub.

@wxiaoguang commented on GitHub (Oct 11, 2021): I think it's not a bug. The comparison is the diff between the revision you clicked and the previous one (by design) https://github.com/go-gitea/gitea/pull/16909/files#diff-037377fd456709d4b4c433f026ae6308d3f6e6e19803346d287122cd3e57d780R205 https://github.com/go-gitea/gitea/pull/16909/files#diff-b5a5516f3106eb20d94409396e829ab0c2fdf354d01382495984baefe885f75bR130 If you click the first revision, it just shows the first revision. You can think about you are seeing a git commit. ps: the "Delete" behaivor is a little different from GitHub, GitHub doesn't allow users to delete the latest one, but I think it's not a necessary check, so I didn't follow GitHub.
Author
Owner

@qwerty287 commented on GitHub (Oct 11, 2021):

Ok, I wanted to point out: if I delete the latest revision, it won't be deleted - it will be shown in the comment field

@qwerty287 commented on GitHub (Oct 11, 2021): Ok, I wanted to point out: if I delete the latest revision, it won't be deleted - it will be shown in the comment field
Author
Owner

@wxiaoguang commented on GitHub (Oct 11, 2021):

Yep, I have thought about this problem, but it makes code more complex and doesn't bring much benefit (for me 😂), so I choose to not to implement now. If it's necessary, we can implement it later.

@wxiaoguang commented on GitHub (Oct 11, 2021): Yep, I have thought about this problem, but it makes code more complex and doesn't bring much benefit (for me 😂), so I choose to not to implement now. If it's necessary, we can implement it later.
Author
Owner

@delvh commented on GitHub (Oct 11, 2021):

I can totally understand that decision: Otherwise, the code complexity increases from constant time to linear time as you then have to backtrack the history to the most recent non-deleted revision, which can take up to n times for a history of size n. And that even ignores the potential problems you might encounter with that feature.

@delvh commented on GitHub (Oct 11, 2021): I can totally understand that decision: Otherwise, the code complexity increases from constant time to linear time as you then have to backtrack the history to the most recent non-deleted revision, which can take up to n times for a history of size n. And that even ignores the potential problems you might encounter with that feature.
Author
Owner

@wxiaoguang commented on GitHub (Oct 11, 2021):

Maybe we can close this issue, if we meet new requirements, let's continue to improve.

@wxiaoguang commented on GitHub (Oct 11, 2021): Maybe we can close this issue, if we meet new requirements, let's continue to improve.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7963