fix(core): improved state_req handling
This commit is contained in:
parent
ff6ffaf31f
commit
d577f0ed9b
1 changed files with 11 additions and 0 deletions
|
@ -138,6 +138,15 @@ export class SessionConnection extends PersistentConnection {
|
||||||
clearTimeout(timeout)
|
clearTimeout(timeout)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// resend pending state_req-s
|
||||||
|
for (const msgId of this._session.pendingMessages.keys()) {
|
||||||
|
const pending = this._session.pendingMessages.get(msgId)!
|
||||||
|
|
||||||
|
if (pending._ === 'state') {
|
||||||
|
this._onMessageFailed(msgId, 'connection loss', true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.emit('disconnect')
|
this.emit('disconnect')
|
||||||
|
|
||||||
this.reset()
|
this.reset()
|
||||||
|
@ -1176,6 +1185,8 @@ export class SessionConnection extends PersistentConnection {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._session.pendingMessages.delete(msgId)
|
||||||
|
|
||||||
switch (status & 7) {
|
switch (status & 7) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
|
|
Loading…
Reference in a new issue