Skip to content
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 #159404

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 26, 2024

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

Forward-Port-Of: #159190
Forward-Port-Of: #158087

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: 039d596
@robodoo
Copy link
Contributor

robodoo commented Mar 26, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 26, 2024

@tsm-odoo this PR targets master and is the last of the forward-port chain.

To merge the full chain, use

@fw-bot r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the RD research & development, internal work label Mar 26, 2024
@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 26, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 26, 2024

@tsm-odoo ci/runbot failed on this forward-port PR

@tsm-odoo
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 29, 2024
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 #159404

X-original-commit: 039d596
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
@robodoo robodoo closed this Mar 29, 2024
@robodoo robodoo added the 17.3 label Mar 29, 2024
@fw-bot fw-bot deleted the master-saas-17.1-fix_unread_counter-tsm-PEFS-fw branch April 12, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17.3 forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants