-
Notifications
You must be signed in to change notification settings - Fork 8
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
[COL-335] Fix bug where space.enter()
sometimes hangs.
#227
Commits on Oct 19, 2023
-
Remove mocking of presence enter completion in space.enter() test
space.enter() doesn’t await the result of the presence enter operation (whether it should or not is another matter), and the other tests for space.enter() don’t mock its completion, so let’s be consistent with them.
Configuration menu - View commit details
-
Copy full SHA for 72696f8 - Browse repository at this point
Copy the full SHA 72696f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f827d5a - Browse repository at this point
Copy the full SHA f827d5aView commit details -
Make each test context create new mock objects
This removes the possibility of one test case affecting another due to shared mock objects.
Configuration menu - View commit details
-
Copy full SHA for c66bd09 - Browse repository at this point
Copy the full SHA c66bd09View commit details -
Remove unnecessary space.enter() from some tests
These calls presumably exist because the method that they are testing requires that the client has entered the space. But calling `space.enter()` in the context of these tests does nothing useful — the underlying Realtime object is a mock, and the `presenceMap` objects in the tests’ contexts have already been configured such that a member is present for the space’s connection ID.
Configuration menu - View commit details
-
Copy full SHA for ce44eb9 - Browse repository at this point
Copy the full SHA ce44eb9View commit details -
Remove usage of private presence API
Instead of using the private `subscriptions` property, implement a `once`-like behaviour by passing `subscribe` a listener that removes itself once triggered.
Configuration menu - View commit details
-
Copy full SHA for 1431c3c - Browse repository at this point
Copy the full SHA 1431c3cView commit details -
Check sender of ENTER presence message in space.enter()
It shouldn’t return as a result of somebody else entering the space. I’m not sure whether this is the best way of predicating whether or not to return — perhaps checking for some unique ID on the received ENTER presence message would be better. But it seems like an OK low-thought solution at least for the time being.
Configuration menu - View commit details
-
Copy full SHA for 6f513a1 - Browse repository at this point
Copy the full SHA 6f513a1View commit details -
Fix bug where space.enter() sometimes wouldn’t return
Calling presence.enter() does not necessarily result in the presence object emitting an ENTER event. This could happen, for example, if the channel does not become attached quickly enough, or if a transport upgrade is happening at roughly the same time as the presence enter call (note that the latter possibility means that we wouldn’t gain much by trying to work around the former by making sure the channel becomes attached before performing the presence enter). In both these cases, the only visible side effect of the presence enter call will be a PRESENT event emitted as a result of a presence SYNC. So, we update space.enter such that it also will return if it receives a PRESENT event for the current member. Resolves COL-335.
Configuration menu - View commit details
-
Copy full SHA for 803416d - Browse repository at this point
Copy the full SHA 803416dView commit details