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

feat: trigger reconnect on emit if not connected #162

Merged
merged 6 commits into from
Oct 24, 2023

Conversation

gismya
Copy link
Contributor

@gismya gismya commented Oct 11, 2023

  • I have added automatic tests where applicable
  • The PR title is suitable as a release note
  • The PR contains a description of what has been changed
  • The description contains manual test instructions

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?

@gismya gismya requested a review from a team as a code owner October 11, 2023 11:25
@ffMathy
Copy link
Contributor

ffMathy commented Oct 17, 2023

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", () => {
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already implemented ⭐

@ffMathy
Copy link
Contributor

ffMathy commented Oct 24, 2023

This is a very valued change. Thank you!

Copy link
Contributor

@jimmycallin jimmycallin left a 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!

@gismya gismya merged commit f629062 into main Oct 24, 2023
5 checks passed
@gismya gismya deleted the more-aggressive-reconnect-behaviour branch October 24, 2023 12:01
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.

3 participants