-
Notifications
You must be signed in to change notification settings - Fork 509
feat: celery task + admin to resend Messages #8661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Adds complexity and risk - the improved Messages admin lets us do most of what it did without the opportunity for accidentally resending huge ranges
rjsparks
previously approved these changes
Mar 14, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8661 +/- ##
==========================================
- Coverage 88.88% 88.80% -0.08%
==========================================
Files 312 314 +2
Lines 40891 41243 +352
==========================================
+ Hits 36345 36627 +282
- Misses 4546 4616 +70 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rjsparks
approved these changes
Mar 15, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adds a celery task to resend messages and enhances the Messages admin page to provide an interface for using the task.
The task defaults to sending only unsent Messages (i.e., those for which
sent
isNone
), but has a flag to allow resending already sent messages. This is not exposed through the UI because it's unclear that we'd ever actually want to do that. The use case would, I think, be that thesent
timestamp was set for messages not actually sent - I think a better and safer workflow would be to mark these as unsent, then use this task. A need to do this has not arisen recently as far as I know.The admin page now indicates whether or not each message in the listing was sent and provides filters for sent vs not sent and for date ranges, including custom date range. This allows the same selection flexibility as the old management command, with the one limitation being that at most 100 messages can be selected at once due to the admin's pagination. I think this is a feature, though, as we want to be careful about sending large numbers of messages in one go.
There is a bit of a risk of sending duplicate messages if multiple copies of the celery task are executed for overlapping sets of messages. I'm leaving guarding against this for future work as it's going to take some exploration and I think use of this tool will be rare enough that we can trust ourselves to manage the risk.