Skip to content

Unsubscribe subscribers whose Telegram account is gone - #17

Merged
mergify[bot] merged 1 commit into
mainfrom
sweep-gone-subscribers
Oct 22, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
sweep-gone-subscribers

Conversation

@littlenano

@littlenano littlenano commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

The subscriber sweep drops subscribers whose get_chat_member reports user not found. An id Telegram cannot resolve as a chat participant also surfaces as

can not check subscriber Telegram { user_id: 8592764017, … } in chat -1001455914104:
A Telegram's error: Unknown error: "Bad Request: PARTICIPANT_ID_INVALID"

which is an ApiError::Unknown (teloxide has no variant for it), so it was only logged as a warning on every update while the subscriber stayed subscribed forever.

What the error means

Either way the id cannot resolve as a member of the chat, so it cannot be mentioned there: keeping the subscription changes nothing. sweep_subscribers() therefore treats it like user not found and removes the subscriber with an info log instead of a warning.

Other API errors (chat not found, retry after, network, …) still keep the subscriber and warn, and a member status that is simply not a member was already handled by is_member().

Verification

  • cargo test --all-targets: 9 passed (the sweep mechanics are covered by update_subscribers_removes_invalid_and_renames; the error classification is a two-line match, not worth a test that would only restate the constant)
  • cargo clippy --all-targets, cargo fmt --check: clean
  • Merged with current main (post dependency update, rustc 1.99.0): cargo check --all-targets clean, cargo test 14 passed

@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Queued — the merge queue status continues in this comment ↓.

Co-authored-by: Lin Yinfeng <lin.yinfeng@outlook.com>
@littlenano
littlenano force-pushed the sweep-gone-subscribers branch from a66e413 to 4c69e9b Compare October 22, 2026 06:53
@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 1 minute 19 seconds in the queue, including 36 seconds running CI.

Required conditions to merge
  • #check-failure = 0
  • check-success = check

@mergify mergify Bot added the queued label Oct 22, 2026
@mergify
mergify Bot merged commit 8a6c37e into main Oct 22, 2026
6 checks passed
@mergify mergify Bot removed the queued label Oct 22, 2026
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