Skip to content

Filter notifications with `nil` object

Alex Gleason requested to merge notifications-nil-objects into develop

I wasted a few hours making this MR, only to realize the behavior is exactly the same as before. safe_render_many/4 already handles it (and even produces a correct API response), it just produces an error in the logs when it does.

The real solution is to get rid of the notifications from the database that still reference a nil object. TRUNCATE TABLE notifications; would work, or a less heavy-handed query that deletes only orphaned ones.

Posting this anyway for posterity and to prove that I did it, but it was a waste of my time. There are no performance implications whatsoever. Just delete these lines of code and it would have the exact same result:

Screenshot_from_2022-03-29_13-04-33

Merge request reports

Loading