Linking Telegram with a large contact list overloads the app #53

Open
opened 2026-10-27 01:59:54 +00:00 by bmt · 1 comment
Member

build: anotherim-js 0.7.5-beta1

After linking a Telegram account with about 1500 contacts, the app syncs the whole archive and imports all contacts at once.
Meanwhile the app lags, sent messages hang or fail with a timeout, and the connection to the server keeps dropping.
Unlink hangs because its answer is lost on the dropped connection.

expected: the app stays responsive and syncing runs gradually in the background

actual: the app lags, messages don't send properly, the connection drops every minute

build: anotherim-js 0.7.5-beta1 After linking a Telegram account with about 1500 contacts, the app syncs the whole archive and imports all contacts at once. Meanwhile the app lags, sent messages hang or fail with a timeout, and the connection to the server keeps dropping. Unlink hangs because its answer is lost on the dropped connection. expected: the app stays responsive and syncing runs gradually in the background actual: the app lags, messages don't send properly, the connection drops every minute
Owner

Status update.

Already released (tackygram 0.3.6 + another.im 0.7.6):

  • Phone-book-only contacts (people you never chatted with on Telegram) are no longer imported, and their old "wants to add you" requests are withdrawn at the next sync.
  • Subscription requests from contacts of a gateway you are registered with are approved automatically, so the flood of requests no longer reaches you.

Coming in tackygram 0.3.7 + another.im 0.7.7:

  • When the server does not grant the gateway roster access (no XEP-0356 privilege), linking no longer sends hundreds of subscription requests and presences. The gateway keeps your Telegram chat list (newest first) and New chat / search find chats in it by name; a contact is added only when you first write to it or it writes to you.
  • With roster access, the per-contact work (roster, presence, avatars, first history fill) goes through one paced queue instead of all at once, and the first history fill per chat is capped.

Leaving this open until 0.3.7 / 0.7.7 are out; please tell us if linking still feels heavy after that.

Status update. Already released (tackygram 0.3.6 + another.im 0.7.6): - Phone-book-only contacts (people you never chatted with on Telegram) are no longer imported, and their old "wants to add you" requests are withdrawn at the next sync. - Subscription requests from contacts of a gateway you are registered with are approved automatically, so the flood of requests no longer reaches you. Coming in tackygram 0.3.7 + another.im 0.7.7: - When the server does not grant the gateway roster access (no XEP-0356 privilege), linking no longer sends hundreds of subscription requests and presences. The gateway keeps your Telegram chat list (newest first) and New chat / search find chats in it by name; a contact is added only when you first write to it or it writes to you. - With roster access, the per-contact work (roster, presence, avatars, first history fill) goes through one paced queue instead of all at once, and the first history fill per chat is capped. Leaving this open until 0.3.7 / 0.7.7 are out; please tell us if linking still feels heavy after that.
ann referenced this issue from a commit 2026-10-27 09:03:16 +00:00
New chat and the chat list's search find a linked gateway's own chats, for a Telegram account with 1000+ chats behind a server that gives tackygram no roster privilege (#53, #54): ui/src/state/gateway-contacts.ts asks each gateway the account registered with (or one online whose registration is not read yet; never the telephone one) for its disco#items at node `contacts` (XEP-0030, paged by XEP-0059, which libtacky's `disco items` follows to the end), keeps the list per account and gateway, reads it again when New chat opens, when a search starts and when the gateway's presence or registration moves (one request in flight per gateway, a refusal keeping what was there, a gateway still reading the chats (resource-constraint, tackygram's "ask again") asked again 4 s later up to three times, an unlink dropping it), takes tackygram 0.3.7's "Name (@username)" and "@username" apart and searches by name, @username or address (text starting with @ by the username alone). New chat lists the matches no contact or chat row shows already under "Telegram" (the network's name), the first 50 and "{n} more: type more of the name", with the @username or the network under each, and with the field empty says "Type a name to search your 1500 Telegram chats" instead of listing them; the chat list's search does the same under its Contacts. Picking one opens the chat with <id>@<gateway> and sends no roster add: the first message, or the gateway's subscribe that #54's auto-approve takes, brings the contact in, and until the backend has a row withGatewayRow draws the open chat by the gateway's name (app shell and Ctrl+W). The mock's Telegram gateway lists 1,500 invented chats at that node (every seventh as "Name (@username)", every 97th as "@username" alone); test/gateway-contacts.test.ts covers the parsing, the reads and re-reads, the search's cap and skips, the picker and the chat list (state module 100 % of lines); en, es, et, ru, uk catalogues; CHANGELOG and docs/features.md say so. make check STRICT=1 (0 missing in every catalogue) and make test-ui (3,967 passed) pass; New chat and the search drawn at 360 and 1200 px in WebKitGTK on the mock.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
another-im/anotherim-js#53
No description provided.