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

[MMB-115] Handle connection id race condition #70

Merged
merged 2 commits into from
May 30, 2023

Conversation

dpiatek
Copy link
Contributor

@dpiatek dpiatek commented May 25, 2023

The Ably client, after being instantiated, takes a little while to connect (depending of course on the network). This conflicts with many parts of the library, where we expect the connectionId to be always there, the member to have entered etc.

To assist with this, instead of requiring the developer to wait for the connection, we can make sure the connection is setup when we initiate the space:

const space = await spaces.get('myspace')

Dominik Piatek added 2 commits May 25, 2023 16:59
Setting a location or cursor position requires two things:
- a connection to Ably
- entering a space

This takes care of the former, modifying .get to await the connection for Ably.
@dpiatek dpiatek marked this pull request as ready for review May 30, 2023 08:26
@dpiatek dpiatek merged commit 53f87c4 into main May 30, 2023
@dpiatek dpiatek deleted the mmb-115-handle-connection-id-race-condition branch May 30, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant