-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Ignore missing comment for user notifications #18954
Conversation
What about instead making sure to remove notifications when deleting issues, comments, repos etc? I also didn't consider this with my recent issue removal move, but I think it's even better? |
@fnetX This would definitely be cleaner in general, but I imagine that this would also involve a bit more than a one-line fix (:sweat_smile:), which my golang / gitea knowledge probably won't suffice to tackle. You would also have to consider that deleting a comment doesn't necessarily mean that you can delete the whole notification, since the user might still have unread comments in that issue that were written before the deleted comment. So it may be necessary to keep track of the read status of individual items in the timeline of an issue / PR to do this properly. Apart from all that, as I said, this is probably out of scope for me / this PR (which just aims to fix the 500). |
Yeah, I mainly considered if I should try to get some tiny fixes into my #18953, but you are right about the read state. Removing notifications for removed repos and whole issues should be safe and somewhat easy, I can attempt that. |
* main: ignore missing comment for user notifications (go-gitea#18954) allow overwrite artifacts for github releases (go-gitea#18987) fix & refactor (go-gitea#18973) Don't clean up hardcoded `tmp` (go-gitea#18983) git backend ignore replace objects (go-gitea#18979) Improve the deletion of issue (go-gitea#18945) Add note to GPG key response if user has no keys (go-gitea#18961) adds restore docs for docker based instances (go-gitea#18844) Refactor admin user filter query parameters (go-gitea#18965)
* giteaofficial/main: Fix EasyMDE error when input Enter (go-gitea#19004) Fix update hint bug (go-gitea#18996) Fix the editor height in review box (go-gitea#19003) Add a "admin user generate-access-token" subcommand (go-gitea#17722) Fix potential assignee query for repo (go-gitea#18994) Add config option to disable "Update branch by rebase" (go-gitea#18745) Update `go-enry` to v2.8.0 (go-gitea#18993) homebrew updates via cron ignore missing comment for user notifications (go-gitea#18954) allow overwrite artifacts for github releases (go-gitea#18987) fix & refactor (go-gitea#18973)
Backport go-gitea#18954 * ignore missing comment for user notifications * instead fix bug in notifications model * use local variable instead Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* ignore missing comment for user notifications * instead fix bug in notifications model * use local variable instead Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
This extends #17550 to another place, where an internal server error may occur, when a notification is pointing to a deleted comment. (In fact, this fixes the original issue in #17499, which occurred in the user notification endpoint.)
Tested and is working for me.