mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
FIX: Make chat tracking payload backwards compatible (#20852)
Followup cab4b2cfba20ea03adb14e994c145e15c5ae8a2c, this was causing client JS errors because the old version of the client was expecting the old keys, but the new ruby version of the app was sending different keys via the MessageBus payload. We can remove this in a couple of weeks.
This commit is contained in:
@ -129,7 +129,14 @@ module Chat
|
||||
end
|
||||
|
||||
def self.publish_user_tracking_state(user, chat_channel_id, chat_message_id)
|
||||
data = { channel_id: chat_channel_id, last_read_message_id: chat_message_id }.merge(
|
||||
data = {
|
||||
channel_id: chat_channel_id,
|
||||
last_read_message_id: chat_message_id,
|
||||
# TODO (martin) Remove old chat_channel_id and chat_message_id keys here once deploys have cycled,
|
||||
# this will prevent JS errors from clients that are looking for the old payload.
|
||||
chat_channel_id: chat_channel_id,
|
||||
chat_message_id: chat_message_id,
|
||||
}.merge(
|
||||
Chat::ChannelUnreadsQuery.call(channel_ids: [chat_channel_id], user_id: user.id).first.to_h,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user