Skip to content
Snippets Groups Projects

Never return broken notifications #409

What does this PR do?

Since notifications are stored in Redis, we can't expect relational integrity: deleting a user will not delete notifications that mention it.

But if we return notifications with missing bits (a follow without a user, for example), the frontend will get very confused and throw an exception while trying to render them.

This change makes sure we never expose those broken notifications. For uniformity, I've applied the same logic to notes and roles mentioned in notifications, even if nobody reported breakage in those cases.

Tested by creating a few types of notifications with a notifierId, then deleting their user.

Contribution Guidelines By submitting this merge request, you agree to follow our Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
  • I have made sure to test this pull request

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading