Avoid replaying already-posted daily notifications - #153
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39e0157c8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bot_user_id = _coerce_text(read_client.get_current_user_id()) | ||
| if not bot_user_id: | ||
| return False | ||
| recent_messages = read_client.list_channel_messages(channel_id, limit=10) |
There was a problem hiding this comment.
Scan more than 10 messages before suppressing a retry
The replay suppression check only inspects the latest 10 channel messages, so if more than 10 messages are posted after an ambiguous failure, the previously delivered daily notification is missed and the pending item is re-sent again on the next run. In active channels this recreates the duplicate-post loop this change is trying to prevent; consider paginating history (or scanning since created_at) instead of hard-capping at 10.
Useful? React with 👍 / 👎.
Summary
Context
delivery failure: 1件Verification
/Users/kentokumatsunami/Documents/GitHub/comic_crawler/.venv/bin/python -m unittest tests.test_runner tests.test_discord_outbound/Users/kentokumatsunami/Documents/GitHub/comic_crawler/.venv/bin/python -m unittest discover -s tests -p 'test_*.py'git diff --checkResidual Risks