You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diag(telegram): add per-batch progress logging to getAudioMessages pagination
A 100,000-message channel requires roughly 1,000 sequential round
trips through SearchChatMessages — confirmed across multiple
independent TDLib binding docs that its limit parameter has a hard
server-side cap of 100, so this isn't tunable away, and pagination
is inherently sequential since each request needs the previous
response's nextFromMessageId as a cursor.
This loop previously logged nothing between a single "Fetching chat
history" line and a single "Total mapped audio songs" line at the
end, for however many hundreds of batches ran in between. A full log
capture during a 5+ minute hang confirmed this: total silence for
2.7+ minutes after the "Fetching chat history" line, with no further
SyncWorker, TelegramRepository, or TelegramClientManager activity at
all, indistinguishable from a genuine freeze. Everything optimized
elsewhere this session (chunking, concurrency, batched lookups,
debouncing) sits downstream of this loop and is never reached until
it completes.
clientManager.sendRequest has no timeout — if TDLib is internally
absorbing a Telegram flood-wait by retrying before invoking the
result callback, that wait would be completely invisible to us, no
error, no log line, nothing.
Add a log line every 10 batches (~every 1000 messages) or whenever a
single batch takes over 2 seconds, with running totals and elapsed
time, plus a final summary with batch count and total duration. Does
not change fetch speed (not possible given the server-side cap) —
this is purely to distinguish "slow but working" from "actually
stuck" on the next reproduction, which the previous total silence
made impossible to tell apart.
0 commit comments