Skip to content

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.

@gismya gismya requested a review from jimmycallin October 20, 2023 07:04
// 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
@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

4 participants