-
Notifications
You must be signed in to change notification settings - Fork 341
fix(NA): Non forced close without connection terminate and also some connection's flow improvements #197
fix(NA): Non forced close without connection terminate and also some connection's flow improvements #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
src/client.ts
Outdated
|
||
if (isForced) { | ||
if (this.checkConnectionIntervalId) { | ||
clearInterval(this.checkConnectionIntervalId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should set this with undefined or null
src/client.ts
Outdated
@@ -424,15 +456,37 @@ export class SubscriptionClient { | |||
} | |||
|
|||
private checkConnection() { | |||
this.wasKeepAliveReceived ? this.wasKeepAliveReceived = false : this.close(false); | |||
this.wasKeepAliveReceived ? this.wasKeepAliveReceived = false : this.close(false, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please convert into full if and not shortend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fix CI and I think we can merge it :)
@Urigo
clearTimeout(this.maxConnectTimeoutId); | ||
this.maxConnectTimeoutId = null; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reformat :)
@Urigo @dotansimha @DxCx
This PR solves the following issue: usually when a backend receives a
connection_terminate
will invalidate the previous credentials so we should only send connection_terminate in aforceClose
.