mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix complete directory sync for late web clients
This commit is contained in:
1 parent
aa5c5e687f
commit
d7766497e8
3 files changed
+48
-10
No files matched your search
@@ -31,3 +31,16 @@ test("directory state and movement events remain isolated per session", () => {
|
||||
assert.deepEqual(first.getSnapshot()?.clients.map((item) => [item.id, item.channelID]), [[3, 2n]]);
|
||||
assert.deepEqual(second.getSnapshot()?.clients.map((item) => [item.id, item.channelID]), [[3, 1n]]);
|
||||
});
|
||||
|
||||
test("directory synchronizer keeps clients across staged partial snapshots", () => {
|
||||
const sync = new DirectorySynchronizer();
|
||||
const alice = client(7, "Alice", 1n);
|
||||
const bob = client(8, "Bob", 1n);
|
||||
|
||||
sync.applySnapshot({ channels: [root], clients: [alice, bob] });
|
||||
sync.applySnapshot({ channels: [root], clients: [bob] });
|
||||
assert.deepEqual(sync.getSnapshot()?.clients.map((item) => item.id), [7, 8]);
|
||||
|
||||
sync.applyClientLeave(alice.id);
|
||||
assert.deepEqual(sync.getSnapshot()?.clients.map((item) => item.id), [8]);
|
||||
});
|
||||
Reference in new issue
Block a user