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

Error 420 Flood Wait Failed #2286

Closed bubblecsh closed 1 year ago

bubblecsh commented 1 year ago

Hey, i have telegram account with high activity and lots of messages sent and received all the time which is connected to tdlib. If i launch tdlib after being off for some hours first i get a bunch of these delays which i believe are handled by tdlib:

[ 2][t 4][1674826840.746383666][NetQueryDelayer.cpp:83][#1][!NetQueryDelayer] Delay: [Query:[id:52822016][tl:0x4423e6c5][state:Query]] [timeout:25][total_timeout:25] because of [Error : 420 : FLOOD_WAIT_25] from Session:2:main::Connect::Tcp::[149.154.167.51:443] to DcId{2} from [172.18.0.2:49696]

But then there are also lots of these:

[ 2][t 4][1674826897.016707897][NetQueryDelayer.cpp:74][#1][!NetQueryDelayer] Failed: [Query:[id:38207488][tl:0x4423e6c5][state:Query]] [timeout:30][total_timeout:90] because of [Error : 420 : FLOOD_WAIT_30] from Session:2:main::Connect::Tcp::[149.154.167.51:443] to DcId{2} from [172.18.0.2:49696]

Does tdlib handle them? I just want to make sure that there are no missing new chat and new message events. Thanks.

levlam commented 1 year ago

Those are getChatHistory requests.

bubblecsh commented 1 year ago

Are they initiated by tdlib?

levlam commented 1 year ago

This is possible, but very unlikely.

bubblecsh commented 1 year ago

My app is only making getChat and downloadFile requests so idk where getChatHistory is coming from. Can these errors affect updateNewMessage events that are coming from tdlib when it is just launched?

levlam commented 1 year ago

No. getChatHistory is automatically called only when the last message in a chat becomes unknown (i.e. deleted) and must be repaired.

bubblecsh commented 1 year ago

Make sense now, thanks!