tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Client seems to stop receiving most updates after some time in operation #2930

Closed sachssem closed 4 months ago

sachssem commented 4 months ago

Hey,

I've been using the Node.js bindings implementation of tdlib (https://github.com/Bannerets/tdl) for 3-4 months now without any issues (hosted on a cloud server). But at the start of this month I experienced some issues. At first my app stopped receiving updates at all, after updating the bindings library and the prebuilt-tdlib to the then newly released versions it worked again. But soon after it started to behave strangely in the cloud:

I started to disable/remove all of my "advanced" features (everything except the 'on update' handler and one 'getMessage' call to be exact), because I've read about other issues where the receive function was blocked by some never ending API call, but it didn't solve the problem.

Yesterday I increased the verbosity level to 3, but I can't find any obvious issues in the logs as tdlib seems to be fetching updates all day long: [ 3][t 0][1718150628.588677167][Client.cpp:280][&td_requests] Begin to wait for updates with timeout 10.000000 [ 3][t 0][1718150638.589522123][Client.cpp:293][&td_requests] End to wait for updates, returning object 0 0x0

My tdl and prebuilt-tdlib versions are up to date: "prebuilt-tdlib": "0.1008030.0", "tdl": "8.0.0",

In another issue there was a similar problem when someone received updates with a huge delay, compared with TG web client or mobile app - and the solution was to update tdlib. But in my case the prebuilt-tdlib version is up to date. Could compiling tdlib myself resolve the problem (using the latest tdlib version and not the latest prebuilt one)?

I really don't know what else could be causing this behaviour as it worked without any issues for multiple months and now this weird behaviour occurs, which is hard to debug as I can't even reproduce it locally...

Any ideas on why this happens or how to continue debugging this? Thanks in advance!

levlam commented 4 months ago

All apps receive updates in supergroups and channels in the same way, so there can be no app-specific issues.

a few messages get delivered in the course of a day

It is not possible to receive messages in a channel out of order. If some messages were skipped, then the app will receive updateChatLastMessage with last_message == null before updateNewMessage, but this is unlikely to happen while the app is online.