Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

pavkam
Copy link
Contributor

@pavkam pavkam commented Nov 2, 2023

This PR re-arranges some code to move "get a new token" retry from inside the "event listener's" loop and join it to the main retry loop.

This is to avoid any hypothetical situation when Ably misbehaves about our tokens' validity and we constantly try to obtain a new token and connect to Ably, thus entering an unwanted loop.

To improve things, I have also made sure that when we connect successfully, we reset the retry count to its default value to not exhaust retries on normal reconnects due to token expiration.

@pavkam pavkam self-assigned this Nov 2, 2023
Copy link
Contributor

@rrpff rrpff left a comment

Choose a reason for hiding this comment

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

Changes look sound to me 👍

Copy link
Contributor

@matus-vacula matus-vacula left a comment

Choose a reason for hiding this comment

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

Looks good!

Co-authored-by: Matus Vacula <[email protected]>
@pavkam pavkam merged commit 8b7cd80 into main Nov 8, 2023
@pavkam pavkam deleted the fix-repeat-auth-connect branch November 8, 2023 17:00
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.

4 participants