Open kescherCode opened 3 months ago
Now, the question is whether status being null is the bug here, or such null statuses not being filtered from notifications
Given null checks are present for other notification types, I'd say it's the latter.
Manually deleting all "status" type notifications where no status exists is a working workaround, too. There were over 5000 such notifications in the database since catcatnya.com has started to exist.
Can you retry with the last update? I suspect it behaves better. But it sounds like there's something weird going on. We technically expect some orphaned notifications for various reasons (basically polymorphism and race conditions), so it is good to guard against null statuses in the clients, but over 5k seems a bit much.
but over 5k seems a bit much.
5k notifications since 2022, for the entire userbase of 150+ monthly active users. I think that's not that bad. There are worse issues in Mastodon.
Can you retry with the last update?
As production yields no new such notifications since my report (since no one rapid fire posted-and-deleted), I've gone ahead and injected a fake entry to bring back the issue (and then, just as I did that, someone managed to actually do it again, causing two entries for two users, one of those being me), then upgraded. Result: Notifications no longer result in an error, so it no longer breaks. However, there is an empty notification whenever the status can't be found:
Btw, here's a quick query to run to get any such notifications:
select * from notifications n where n.type='status' and not exists (select s.id from statuses s where n.activity_id = s.id);
If you think the empty notification is not a big deal, feel free to close the bug.
It's not a very big deal but it's still a bug that needs to be investigated, at the very least on the display side.
I think it has been addressed with recent changes, although the underlying cause still needs to be investigated
Steps to reproduce the problem
Expected behaviour
Notifications load without any issue
Actual behaviour
Oops! An unexpected error occurred.
Detailed description
No response
Mastodon instance
catcatnya.com, cts.kescher.at, local dev container with artificial data
Mastodon version
commit 32717657ceb9898e9d502a87043b5716e86bd67c, but probably occurs since initial implementation
Browser name and version
Recent versions of both Chromium and Firefox
Operating system
Linux, Android
Technical details
Error is:
Leading me to this line: https://github.com/glitch-soc/mastodon/blob/c72b6e03ec6b4042dbf958a979b02cc6870128a9/app/javascript/flavours/glitch/actions/importer/index.js#L64
Here is a redacted JSON object that's part of the response of
/api/v2_alpha/notifications?exclude_types[]=follow_request&exclude_types[]=favourite&exclude_types[]=update&exclude_types[]=reaction&exclude_types[]=mention&exclude_types[]=follow&exclude_types[]=admin.report&exclude_types[]=reblog&exclude_types[]=admin.sign_up&exclude_types[]=poll
:Note that usually, status is populated.