Fix payouts notifications not delivering#5430
Merged
fetchfern merged 5 commits intomodrinth:mainfrom Feb 26, 2026
Merged
Conversation
422595e to
07350ac
Compare
07350ac to
446f398
Compare
fetchfern
requested changes
Feb 26, 2026
Contributor
fetchfern
left a comment
There was a problem hiding this comment.
Thanks! Due to infra constraints would rather keep that query out of migrations - we'll run it ourselves, otherwise LGTM
…ued all at once upon fix" This reverts commit 446f398.
fetchfern
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5427
1. Fix the bug
Return the list of actually inserted notification IDs, after filters, so uninserted rows don't get referenced in a foreign key, causing an FK violation.
This FK violation rolls back the entire transaction, so payout email notifications always fail.
2. Add a test case
Add a test case to prevent regressions and demonstrate the problem in action without the fix applied.
3. Add migration to prevent bugged backlog being emptied(rolled back)In the
payouts_values_notificationstable, there will be a HUGE backlog ofnotified = FALSE, one for every user with a payout, for every month this bug has existed (probably from implementation of payout notifications).Once this bug is fixed, the backlog will be emptied. Resulting in tens of thousands of emails being sent for ancient payouts.
It would be emptied slowly, 200 every 6 hours.
So I added a migration to update stale
payouts_values_notificationsrows tonotified = TRUE.