Skip to content

fix(plugins): stop duplicate_spam from starving bio_bait_spam at group=4#21

Merged
rezhajulio merged 1 commit into
mainfrom
fix/bio-bait-group-collision
Jul 4, 2026
Merged

fix(plugins): stop duplicate_spam from starving bio_bait_spam at group=4#21
rezhajulio merged 1 commit into
mainfrom
fix/bio-bait-group-collision

Conversation

@rezhajulio

Copy link
Copy Markdown
Owner

Summary

  • duplicate_spam and bio_bait_spam both register at PTB group=4 with the identical filter (GROUPS & ~COMMAND)
  • PTB checks handlers within a group in registration order and stops at the first match by default (block=True); duplicate_spam registers first per MANIFEST_ORDER, so bio_bait_spam's callback has never actually fired on a real update
  • Set block=False on both registrations so PTB keeps checking the next handler in the group instead of stopping after the first match
  • ApplicationHandlerStop (raised when either handler actually detects spam) still short-circuits downstream processing as before — this only changes the common case where neither handler finds anything to act on

Test plan

  • uv run pytest - 988 passed
  • uv run ruff check . - clean
  • uv run mypy src/bot/ tests/ - clean
  • Added a regression test asserting block is False on both handlers, named after the collision so future refactors can't silently reintroduce it

duplicate_spam and bio_bait_spam register at the same PTB group (4) with
the identical filter shape (GROUPS & ~COMMAND). PTB checks handlers in
registration order within a group and stops at the first match by default
(block=True), and duplicate_spam registers first per MANIFEST_ORDER — so
bio_bait_spam's callback has never actually run for a real update.

Set block=False on both registrations so PTB keeps checking the next
handler in group=4 after the first one runs. ApplicationHandlerStop
(raised on an actual detection in either handler) still short-circuits
the rest of the pipeline as before, so this only affects the common case
where neither handler finds anything to act on.
@rezhajulio rezhajulio merged commit 7420f02 into main Jul 4, 2026
5 checks passed
@rezhajulio rezhajulio deleted the fix/bio-bait-group-collision branch July 4, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant