Skip to content

fix: skip get_dialogs() in whitelist mode to prevent hanging#96

Merged
GeiserX merged 1 commit intomainfrom
fix/whitelist-skip-dialogs
Mar 25, 2026
Merged

fix: skip get_dialogs() in whitelist mode to prevent hanging#96
GeiserX merged 1 commit intomainfrom
fix/whitelist-skip-dialogs

Conversation

@GeiserX
Copy link
Copy Markdown
Owner

@GeiserX GeiserX commented Mar 25, 2026

Summary

Fixes #95 — backup hangs at "Fetching dialog list..." when CHAT_IDS is set.

  • When CHAT_IDS is set (whitelist mode), backup_all() now calls get_entity() for each whitelisted chat directly instead of get_dialogs() which fetches ALL account dialogs
  • For accounts with many chats/groups/channels, get_dialogs() can hang indefinitely or take very long
  • The full dialog fetch + filter path is unchanged for type-based mode (no CHAT_IDS)

Test plan

  • 2 new tests: TestWhitelistModeBackup (verifies get_dialogs not called, handles entity fetch failure)
  • Full test suite passes (167 tests)
  • Ruff lint + format clean

🤖 Generated with Claude Code

When CHAT_IDS is set (whitelist mode), the backup now fetches only the
specified chats via get_entity() instead of calling get_dialogs() which
iterates through ALL account dialogs. For accounts with many chats this
call can hang indefinitely.
@github-actions
Copy link
Copy Markdown

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

@GeiserX GeiserX merged commit 0316c41 into main Mar 25, 2026
7 checks passed
@GeiserX GeiserX deleted the fix/whitelist-skip-dialogs branch March 25, 2026 13:21
@GeiserX GeiserX mentioned this pull request Mar 25, 2026
2 tasks
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.

[Bug]: Stuck at Fetching dialog list

1 participant