You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling cursors.set, before the ::$cursors channel is attached, the set calls fail silently and positions are not emitted. This PR fixes that.
Note:
- After many hours of painfully trying to get the CLI tests to pass, I discovered the issue was not with the tests or the CLI, but the Spaces SDK!
- It's a little disappointing that setting cursor positions is both a) not using async/await, b) has no means to fail given it just sticks the position onto a queue. Whilst I appreciate cursor positions are indeed lower QoS, obvious failures should still propagate back to the caller.
- Seeing that none of the tests are e2e was a bit of a surprise! I suspect stuff like this would have been more obvious with e2e tests. Some high level e2e tests should be added at some point.
Copy file name to clipboardExpand all lines: test/integration/integration.test.ts
+14-5Lines changed: 14 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -178,9 +178,8 @@ describe(
178
178
// 2. one of its `get*()` methods is called
179
179
// 3. its `subscribe` or `unsubscribe` method is called
180
180
//
181
-
// This seems to mean that a client that sends cursor updates but does not listen for them will drop the first update passed to `cursors.set()`.
182
-
//
183
-
// So, to work around this, here I perform a "sacrificial" call to `performerSpace.cursors.set()`, the idea of which is to put `performerSpace.cursors.set()` into a state in which it will not drop the updates passed in subsequent calls.
181
+
// UPDATE: This race condition bug has been fixed. Early cursor positions are now queued and sent when the channel becomes ready.
182
+
// However, we'll keep this "sacrificial" call to ensure the test works correctly with the fix.
0 commit comments