fix(core): silently fail on AUTH_KEY_UNREGISTERED in updates.getState

This commit is contained in:
alina 🌸 2024-06-24 00:39:51 +03:00
parent 64da48926f
commit 34016f849b
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI

View file

@ -269,7 +269,7 @@ export class SessionConnection extends PersistentConnection {
// we must send some user-related rpc to the server to make sure that
// it will send us updates
this.sendRpc({ _: 'updates.getState' }).catch((err: any) => {
if (this._destroyed) return // silently fail
if (this._destroyed || tl.RpcError.is(err, 'AUTH_KEY_UNREGISTERED')) return // silently fail
this.log.warn('failed to send updates.getState: %s', err.text || err.message)
})
}