discourse/plugins/chat
Martin Brennan ae3231e140
FIX: Incorrect unread count shown in channel when message deleted (#21410)
When we were deleting messages in chat, we would find all of
the UserChatChannelMembership records that had a matching
last_read_message_id and set that column to NULL.

This became an issue when multiple users had that deleted message
set to their last_read_message_id. When we called ChannelUnreadsQuery
to get the unread count for each of the user's channels, we were
COALESCing the last_read_message_id and returning 0 if it was NULL,
which meant that the unread count for the channel would be the total
count of the messages not sent by the user in that channel.

This was particularly noticeable for DM channels since we show
the count with the indicator in the header. This issue would disappear
as soon as the user opened the problem channel, because we would then
set the last_read_message_id to an actual ID.

To circumvent this, instead of NULLifying the last_read_message_id in
most cases, it makes more sense to just set it to the most recent
non-deleted chat message ID for the channel. The only time it will
be set to NULL now is when there are no more other messages in the
channel.
2023-05-05 15:28:48 +02:00
..
app FIX: Incorrect unread count shown in channel when message deleted (#21410) 2023-05-05 15:28:48 +02:00
assets UX: scroll to bottom when message is staged (#21408) 2023-05-05 13:14:13 +02:00
config FIX: Thread mention read state and notification links (#21385) 2023-05-04 17:28:51 +02:00
db DEV: Chat thread reply counter cache (#21050) 2023-04-11 15:40:25 +10:00
lib DEV: Create and update chat message mentions earlier (#21388) 2023-05-05 15:47:07 +04:00
public
spec FIX: Incorrect unread count shown in channel when message deleted (#21410) 2023-05-05 15:28:48 +02:00
test/javascripts FIX: Improve chat route cleanup (#20557) 2023-04-26 18:18:23 +02:00
README.md DEV: Chat service object initial implementation (#19814) 2023-02-13 13:09:57 +01:00
plugin.rb DEV: Improve add_to_serializer include_* options (#21220) 2023-04-24 12:17:51 +01:00

README.md

This plugin is still in active development and may change frequently

Documentation

The Discourse Chat plugin adds chat functionality to your Discourse so it can natively support both long-form and short-form communication needs of your online community.

For user documentation, see Discourse Chat.

For developer documentation, see Discourse Documentation.