-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: trigger reconnect on emit if not connected #162
Conversation
From a code standpoint, looks good to me. Haven't tested it. Nice work. |
@@ -456,7 +456,7 @@ describe("Tests using SimpleSocketIOClient", () => { | |||
// Reconnect should not be called yet | |||
expect(client.attemptReconnect).toHaveBeenCalledTimes(0); | |||
}); | |||
test("reconnect method exponentially increase delay for every attempt, stopping at the max value", () => { |
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.
i think it would be helpful with a test that ensures that multiple calls to reconnect during the connection phase does not lead to multiple reconnection attempts in case of failure, just one.
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.
already implemented ⭐
This is a very valued change. Thank you! |
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.
i'm happy with the code changes!
Changes
Fixes an issue that halts reconnection attempts if the failed initialization takes longer than the time to attempt a new reconnection attempt.
Makes the reconnect behavior slightly more aggressive for clients using the WebSocket instance without using the EventServer*.
Took the opportunity to fix some naming inconsistencies.
*Legacy ftrack internal use case, there's no reason to replicate for anyone else
Test
Is there any place this could break anything?