-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Comment history is loading slowly + has an offByOne error #17676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the offByOne happens when editing old issues/comments (created before there was support for edit history). |
👍 Yep, the history menu won't be shown if there is only one history revision (that's by design). For old comments, there was no history revision before, so the first editing would save the first history revision, and the menu would only be shown for the second editing. |
And I haven't noticed any performance problem on my Gitea instance. The menu is always shown within 1 second. If you believe there is a performance problem, please make sure your network is fast enough and help to find which function/sql causes the laggy. |
To support edit history for existing comments: maybe the issue_content_history can be initialized with the initial (is_first_created) content when editing a comment that does not have such an entry yet? |
Agree, it would work. |
Or the issue_content_history could only be populated with the previous value when actually making an edit? |
I have thought about it, but it would make the algorithm more complex (eg: list/diff), usually I prefer a simple and clear solution. And issue contents are much smaller than git repositories, saving the contents won't cost too much in modern days. |
I think this issue can be closed by #17746 The "performance" problem may not be related. If there is really a performance problem, we need more details (and a separate issue) |
Gitea Version
1.16.0+dev-519-g3be156f66
Operating System
Linux
Browser Version
Firefox 94.0
Can you reproduce the bug on the Gitea demo site?
Yes
Description
Gitea now supports the comment history.
However, loading the history seems to be way too slow:
For normal comments, the history will automatically be loaded once the page is reloaded.
Fine so far. Still with a hefty delay (~3 seconds, so you definitely notice when the history suddenly appears), but it loads.
The issue bodies (the description of the issue) are way worse:
According to my tests on try.gitea.io, there seems to be an index error for those, as they only load once a second edit has been made. Once the second edit has been made, it behaves like a normal comment.
So, two things should be done:
Screenshots
This is an issue description where one edit has been made and the page has been force-reloaded. As you see, the history is not getting displayed.
The text was updated successfully, but these errors were encountered: