whereby / sdk

MIT License
11 stars 2 forks source link

core: do not try to connect the room when there's a roomConnectionError #342

Closed nandito closed 1 month ago

nandito commented 1 month ago

Description

Summary:

Extend the selectShouldConnectRoom to check if there's a room connection error and return false if there is. This should prevent the join_room loop if the room is full.

Related Issue:

Testing

  1. Join your normal size room as a host
  2. Fill the .env file with your local-stack endpoints to test against local-stack
  3. Build things yarn build
  4. Start the sample app: yarn dev:sample-app
  5. Join the room with 3 participants => should be ok
  6. Try to join with the 4th participant with devtools > network > ws socket logs open. => gets a disconnected status and there's no sign of infinite join_room call loop in the ws messages.

Screenshots/GIFs (if applicable)

Checklist

Additional Information

There are scenarios where the join_room gets an error. One of them is room_full, but the reason can be the free trial experied, or meeting exhausted (i.e. time limit reached) or missing host, etc. As I see, currently this error state is not exposed in the useRoomConnection's state. This is something we can/could improve.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: d7bad4d59641b95c3cc77ba4b4ee0c8f21ca2fa9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------------------ | ----- | | @whereby.com/core | Minor | | @whereby.com/browser-sdk | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR