Posting to notifications returns a 500 error #73
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Browser
Server log
I tried reproducing this but couldn't so far.
Note that
No such note.
is the logger output, but there should also be a UUID (likely somewhere in the "console" area of your devtools, rather than the "network" component) - could I see which UUID is being thrown?does that help?
vlc and mpv do play< this, my firefox doesnt. just as a notice.
also no uuid or anything logged as far as i can see
The
No such note
error message could be raised when the note a notification is referring to is deleted. But there is a foreign key constraint so if a note gets deleted, any notifications about it should get deleted as well.The other explaination would be that the visibility check fails but I can also not imagine how that would happen. I don't think you should ever get any notifications about a note that you are not allowed to see?
If you (@kura) are feeling adventurous, you can try to check the
notification
table in the database and look at the next ~30 notifications after the last ones you could load and for those that have anoteId
field set to something other than null if there is something strange going on. All those notes should in theory have a visibility where you are allowed to see them.As I already pointed out in #143 what the error you showed initially may indicate is a database timeout.
I also noticed that there is currently no place in the code where notifications are deleted. This means all notifications remain in the database forever (unless deleted through database-internal mechanisms like foreign key constraints). Maybe we should delete notifications that have been read and are older than some threshold (maybe 1 year?).
I think I have to retract this statement. You can e.g. receive notifications about someone renoting one of your notes. But since the renote itself was (somehow without being a quote?) made follower only you cannot see it. For this case I think we may want to adjust the visibility rules.
Further, you may run into problems when your relation to another user changes since visibility/following status is not tracked historically. Therefore, as soon as you unfollow someone you will no longer be able to see any notes from them. Example: They made a follower-only note. You replied to the note yourself. They reacted to the note, causing a notification.
Later you unfollow the other user (or they force-unfollow or block you). While the visibility algorithm allows you to see your own notes, it now determines that you cannot see the replied to note. While packing the notification this causes an error.
There are multiple things we could do to fix this. The easiest but slightly hacky way would be to catch the error and set the reply/renote that gets packed into the notification to
null
or something similar. Note that this would still reveal the renote/reply note id.Alternatively we would have to check the visibility of all notifications relating to a particular pair of users whenever their "relation" changes.
As a workaround you can run this SQL query to clean up such notifications you should not have received: