discourse/plugins/chat/spec/models/chat
David Battersby 67d568f709
FIX: stuck notification for mentions within threads (#30546)
For mentions within threads, the mentioned user can experience a stuck notification. This is due to thread memberships only being created for users who interact with a thread. Without the membership we cannot track if the message containing the mention was read by the user.

The solution to this explored in this PR is:

- auto add memberships for mentioned users (only direct mentions for performance reasons).
- update channel/thread unread queries to check notification read status AND thread membership last read message id when counting mentions.

Previously the mention count would remain until the user notification (containing the mention) was read. However this only happens if the user clicks the notification or clicks dismiss all notifications. When a user navigated to the thread without clicking the notification, the green/urgent badge on chat would remain even after a hard page refresh.
2025-01-06 17:26:37 +04:00
..
category_channel_spec.rb PERF: auto join & leave chat channels (#29193) 2024-11-12 15:00:59 +11:00
channel_archive_spec.rb DEV: add maxlength to additional chat text columns (#23505) 2023-09-12 14:52:50 +08:00
channel_spec.rb FEATURE: add custom fields to chat (channel/message/thread) (#29504) 2024-11-01 09:12:19 +11:00
direct_message_channel_spec.rb DEV: Extract leave logic to the Chat::Channel model 2024-10-17 14:58:45 +02:00
direct_message_spec.rb UX: remove alias from chat direct message channel titles (#28958) 2024-09-18 22:18:46 +04:00
draft_spec.rb
incoming_webhook_spec.rb DEV: add maxlength to additional chat text columns (#23505) 2023-09-12 14:52:50 +08:00
message_reaction_spec.rb DEV: add maxlength to additional chat text columns (#23505) 2023-09-12 14:52:50 +08:00
message_revision_spec.rb DEV: add maxlength limits to chat messages and revisions (#23530) 2023-09-12 18:02:04 +08:00
message_spec.rb FIX: stuck notification for mentions within threads (#30546) 2025-01-06 17:26:37 +04:00
null_message_spec.rb FIX: build chat message excerpt for thread preview (#26765) 2024-04-26 14:29:35 +08:00
null_user_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
reviewable_chat_message_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
thread_spec.rb FEATURE: add custom fields to chat (channel/message/thread) (#29504) 2024-11-01 09:12:19 +11:00
user_chat_thread_membership_spec.rb DEV: Create UserChatThreadMembership table and model (#21481) 2023-05-10 17:19:48 +02:00