FIX: channel_message_bus_last_id was incorrect (#20858)

Followup to 3ea8df4b06,

I forgot to wrap the call to Chat::Publisher.root_message_bus_channel(object.chat_channel.id)
in MessageBus.last_id, so the channel_message_bus_last_id key was
ending up as e.g. "/chat/58" instead of the last ID value.
This commit is contained in:
Martin Brennan 2023-03-28 16:01:27 +10:00 committed by GitHub
parent ddec7bf6a3
commit d8ad5c38b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -128,7 +128,8 @@ module Chat
private
def channel_message_bus_last_id
@opts[:channel_message_bus_last_id] || Chat::Publisher.root_message_bus_channel(object.id)
@opts[:channel_message_bus_last_id] ||
MessageBus.last_id(Chat::Publisher.root_message_bus_channel(object.id))
end
def new_messages_message_bus_id

View File

@ -25,7 +25,7 @@ module Chat
can_delete_self: scope.can_delete_own_chats?(object.chat_channel.chatable),
can_delete_others: scope.can_delete_other_chats?(object.chat_channel.chatable),
channel_message_bus_last_id:
Chat::Publisher.root_message_bus_channel(object.chat_channel.id),
MessageBus.last_id(Chat::Publisher.root_message_bus_channel(object.chat_channel.id)),
}
meta_hash[
:can_load_more_past