FIX: Add MessageBust.last_id to chat channel subscriptions (#19255)

This commit adds variousMessageBus.last_ids to serializer payloads
for chat channels and the chat view (for chat live pane) so
we can use those IDs when subscribing to MessageBus channels
from chat.

This allows us to ensure that any messages created between the
server being hit and the UI loaded and subscribing end up being
delivered to the client, rather than just silently dropped.

This commit also fixes an issue where we were subscribing to
the new-messages and new-mentions MessageBus channels multiple
times when following/unfollowing a channel multiple times.
This commit is contained in:
Martin Brennan
2022-12-02 10:57:53 +10:00
committed by GitHub
parent a2cec6366f
commit 8437081d94
25 changed files with 448 additions and 96 deletions

View File

@@ -39,9 +39,20 @@ acceptance("Discourse Chat | Unit | Service | chat", function (needs) {
unread_mentions: 0,
muted: false,
},
message_bus_last_ids: {
new_mentions: 0,
new_messages: 0,
},
},
],
direct_message_channels: [],
message_bus_last_ids: {
channel_metadata: 0,
channel_edits: 0,
channel_status: 0,
new_channel: 0,
user_tracking_state: 0,
},
});
});