Monday, March 25, 2024
1 change · saas-17.1
Resolved issues and error corrections
This update fixes an issue where a chat could incorrectly show a new unread message immediately after the user sent one, especially on slower connections. The change keeps Discuss message counters accurate and avoids confusing users with false unread notifications.
Original PR description
Before this PR, a race condition occurred when posting a message: if the bus notification was received before the result of the message post RPC, the unread counter was set to the number of messages in the channel. This occurs because the `discuss.channel.member/seen` notification is processed before the `discuss.channel/new_message` one so the message is not yet inserted in `thread.messages`. Steps to reproduce the issue: - Go to discuss as admin - Open a chat with demo - Set network throttling to "fast 3g" - Send a message in the chat - The unread counter is now set to "1" which is incorrect