From af8dc0198c6a22996ce54690cf7141694dd11eaf Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 15 May 2025 19:58:35 -0400 Subject: Fix up spots where we still tried to treat `remote.channels.all` as a map. In ae93188f0f4f36086622636ba9ae4810cbd1f8c9, `remote.channels.all` became a flat array of channels, instead of a map, in order to simplify some of the reasoning around how state changes propagate. However, I neglected to remove all Map-shaped calls referring to it. This lead to some pretty interesting behaviour: * The client could not track unread state, because reconciling local state against the remote state would find no remote state, then throw away local state entirely as a result. * The client would not actually update when a new channel appeared. * The client would not actually update when a channel disappeared. --- ui/lib/session.svelte.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/lib/session.svelte.js') diff --git a/ui/lib/session.svelte.js b/ui/lib/session.svelte.js index 2dae3c4..0b754e5 100644 --- a/ui/lib/session.svelte.js +++ b/ui/lib/session.svelte.js @@ -114,7 +114,7 @@ class Session { onMessage(message) { const event = JSON.parse(message.data); this.remote.onEvent(event); - this.local.retainChannels(this.remote.channels.all.keys()); + this.local.retainChannels(this.remote.channels.all); this.watchdog.reset(this.heartbeatMillis()); } -- cgit v1.2.3