mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: Add last_message_id to channel and thread (#22488)
Initial migration and changes to models as well as changing the following services to update last_message_id: * Chat::MessageCreator * Chat::RestoreMessage * Chat::TrashMessage The data migration will set the `last_message_id` for all existing threads and channels in the database. When we query the thread list as well as the channel, we look at the last message ID for the following: * Channel - Sorting DM channels, and channel metadata for the list of channels * Thread - Last reply details for thread indicators and thread list
This commit is contained in:
@ -112,7 +112,7 @@ describe "Single thread in side panel", type: :system do
|
||||
expect(side_panel).to have_open_thread(thread)
|
||||
thread_page.send_message("new thread message")
|
||||
expect(thread_page).to have_message(thread_id: thread.id, text: "new thread message")
|
||||
thread_message = thread.last_reply
|
||||
thread_message = thread.last_message
|
||||
expect(thread_message.chat_channel_id).to eq(channel.id)
|
||||
expect(thread_message.thread.channel_id).to eq(channel.id)
|
||||
end
|
||||
|
Reference in New Issue
Block a user