Repository navigation
fix: skip target subreddits the bot is banned from - #88
Merged
Merged
Conversation
Check the target's user_is_banned in run_filters before the duplicate scan, and treat SUBREDDIT_NOTALLOWED_BANNED as a graceful crosspost rejection. Co-Authored-By: Toldry <toldry@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ac5m5aP3tK612BNDEstqrD
…t-subreddit # Conflicts: # CHANGELOG.md
Co-Authored-By: Toldry <toldry@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ac5m5aP3tK612BNDEstqrD
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.
Requested by Querent · project thread
Before: when AutoCrosspostBot was banned from the target subreddit, Phase 3 ran the full duplicate scan (13 s in the
--process-onerun that surfaced this) and then the crosspost failed withSUBREDDIT_NOTALLOWED_BANNED, logged asCrosspost failed unexpectedlyat ERROR with a traceback.After: Phases 2 and 3 check the target's
user_is_bannedbefore the duplicate scan and drop the row with reasonBANNED_FROM_TARGET_SUBREDDIT. If a ban lands between that check and the crosspost,SUBREDDIT_NOTALLOWED_BANNEDis now a familiar error and is logged as a graceful rejection at INFO.How:
phase2.is_banned_from_subredditreadsuser_is_bannedthrough the PRAW instance that fetched the comment (one request); if the subreddit can't be read it returns False so the later steps report the real reason. Tests cover the ban rejection, the unreadable-subreddit fallback and the new familiar error type. AGENTS.md and CHANGELOG are updated.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ac5m5aP3tK612BNDEstqrD
Generated by Claude Code