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

Getting a 500 "Request aborted" and 401 "Unauthorized" after `authorizationStateReady` #2334

Closed teleothleo closed 1 year ago

teleothleo commented 1 year ago

Here are the logs: logs.txt

  1. line 1792: authorizationStateReady
  2. line 1836: trying to call this.client!.send({ "@type": "searchPublicChat", username: this.name, });
  3. line 2003: code: 500
  4. line 2452: code: 401

Thanks for such a commitment and quick responses!

teleothleo commented 1 year ago

Also, after refreshing the page (I am using React), TdLib asks for password again. Without asking anything else. This happens a few times, but eventually you get logged in without a password and the 401 error. The 500 however, persists.

AYMENJD commented 1 year ago

tdweb.js:2100 send to worker: {@type: 'close'}

It seems like you are closing the instance which will cause 500 and 401 errors.

teleothleo commented 1 year ago

tdweb.js:2100 send to worker: {@type: 'close'}

It seems like you are closing the instance which will cause 500 and 401 errors.

Yes. I somehow reinitialized the Client when the AuthState got updated. Thank you for the right tip!