Skip to content

A platform for community discussion. Free, open, simple.

FIX: channel_message_bus_last_id was incorrect (#20858)

Martin Brennand8ad5c38b9da
diff --git a/plugins/chat/app/serializers/chat/channel_serializer.rb b/plugins/chat/app/serializers/chat/channel_serializer.rb
index db29fb713ad..fe846ad64ee 100644
--- a/plugins/chat/app/serializers/chat/channel_serializer.rb
+++ b/plugins/chat/app/serializers/chat/channel_serializer.rb
@@ -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
diff --git a/plugins/chat/app/serializers/chat/view_serializer.rb b/plugins/chat/app/serializers/chat/view_serializer.rb
index 271e33ce7a7..ae577ea496d 100644
--- a/plugins/chat/app/serializers/chat/view_serializer.rb
+++ b/plugins/chat/app/serializers/chat/view_serializer.rb
@@ -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