Skip to content

feat: celery task + admin to resend Messages#8661

Merged
rjsparks merged 13 commits intoietf-tools:mainfrom
jennifer-richards:resend-task
Mar 15, 2025
Merged

feat: celery task + admin to resend Messages#8661
rjsparks merged 13 commits intoietf-tools:mainfrom
jennifer-richards:resend-task

Conversation

@jennifer-richards
Copy link
Copy Markdown
Member

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 is None), 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 the sent 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.

image

rjsparks
rjsparks previously approved these changes Mar 14, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.80%. Comparing base (70bf2ae) to head (fcf9b1b).
Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
ietf/message/utils.py 90.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rjsparks rjsparks merged commit 968820d into ietf-tools:main Mar 15, 2025
@jennifer-richards jennifer-richards deleted the resend-task branch March 15, 2025 09:32
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants