Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reconnecting the client #347

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Conversation

vladbat00
Copy link
Contributor

This PR actually fixes #334 (even though it was closed by the author) so that users won't need to employ the hacks by manually reconnecting the client.

Currently, the library handles reconnecting just fine, but only once. As we forget to set userDisconnected to false after connecting, the next fail in the _recvLoop function won't trigger reconnecting again:

if (!this.userDisconnected) {
this._log.error(e);
this._log.warn("Connection closed while receiving data");
this.reconnect();

@Freihart512
Copy link

When will release this change?

@painor
Copy link
Member

painor commented Jun 29, 2022

oh wow I forgot the port this over from https://github.com/Ajaxy/telegram-tt/blob/master/src/lib/gramjs/network/MTProtoSender.js#L172
Thanks for the find.

@painor painor merged commit 67a9b6a into gram-js:master Jun 29, 2022
@vladbat00 vladbat00 deleted the fix-reconnecting branch June 30, 2022 08:53
AnotiaWang added a commit to AnotiaWang/TG_Catbox_Uploader that referenced this pull request Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reconnection problem
3 participants