-
Notifications
You must be signed in to change notification settings - Fork 23.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FW][FIX] mail: incorrect unread counter on message post #159190
[FW][FIX] mail: incorrect unread counter on message post #159190
Conversation
@tsm-odoo cherrypicking of pull request #158087 failed. stdout:
stderr:
Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?). In the former case, you may want to edit this PR message as well. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
2e8947f
to
bc03a9c
Compare
134c78c
to
b776640
Compare
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`. Actually, the channel seen notification is not needed in this case: the last seen message of the author is the message received in the new message notification. 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 X-original-commit: 4a57322
b776640
to
4427327
Compare
@robodoo override=ci/security |
@robodoo r+ |
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`. Actually, the channel seen notification is not needed in this case: the last seen message of the author is the message received in the new message notification. 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 closes #159190 X-original-commit: 4a57322 Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com> Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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 thediscuss.channel/new_message
one so the message is not yet inserted inthread.messages
.Steps to reproduce the issue:
Forward-Port-Of: #158087