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: opening chat with deleted new message should mark as read #159362

Conversation

fw-bot
Copy link
Contributor

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

Before this commit, when a user of in chat posted a message and deleted it, all other users kept the chat as unread.

Steps to reproduce:

  • Connect as Admin and March Demo
  • Send a message to Admin as Demo in DM chat
  • Demo deletes this message
  • Marc opens the chat => the unread counter is 1 and cannot be removed

This happens because when a message is deleted, there's still a trace of it but the message is empty. However, empty messages could not be candidate of setting the last message being seing by a member, thus members were unable to mark the chat as read until someone else posted a newer message (and did not delete it).

This commit fixes the issue by taking empty messages into account for setting last message message of member, which allow to mark thread as read even when newer messages have been deleted.

opw-3764410

Forward-Port-Of: #159192
Forward-Port-Of: #158943

@robodoo
Copy link
Contributor

robodoo commented Mar 26, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 26, 2024

@alexkuhn @seb-odoo cherrypicking of pull request #158943 failed.

stdout:

Auto-merging addons/mail/static/src/core/common/thread_model.js
Auto-merging addons/mail/static/src/core/common/thread_service.js
CONFLICT (content): Merge conflict in addons/mail/static/src/core/common/thread_service.js

stderr:

17:52:29.985264 git.c:463               trace: built-in: git cherry-pick 95fb0c21d3fe2bda63c32a508ccbd5026fc4d90b
error: could not apply 95fb0c21d3fe... [FIX] mail: opening chat with deleted new message should mark as read
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
----------
status:

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.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

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

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Mar 26, 2024
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 26, 2024
Before this commit, when a user of in chat posted a message and
deleted it, all other users kept the chat as unread.

Steps to reproduce:
- Connect as Admin and March Demo
- Send a message to Admin as Demo in DM chat
- Demo deletes this message
- Marc opens the chat
=> the unread counter is 1 and cannot be removed

This happens because when a message is deleted, there's still a
trace of it but the message is empty. However, empty messages could
not be candidate of setting the last message being seing by a member,
thus members were unable to mark the chat as read until someone else
posted a newer message (and did not delete it).

This commit fixes the issue by taking empty messages into account for
setting last message message of member, which allow to mark thread as
read even when newer messages have been deleted.

opw-3764410

X-original-commit: 7c7634e
@alexkuhn alexkuhn force-pushed the master-17.0-fix-chat-deleted-message-counter-aku-cbmD-fw branch from f6b247b to d233f5b Compare March 26, 2024 17:13
@alexkuhn
Copy link
Contributor

@robodoo r+

@C3POdoo C3POdoo requested review from a team March 26, 2024 17:15
robodoo pushed a commit that referenced this pull request Mar 28, 2024
Before this commit, when a user of in chat posted a message and
deleted it, all other users kept the chat as unread.

Steps to reproduce:
- Connect as Admin and March Demo
- Send a message to Admin as Demo in DM chat
- Demo deletes this message
- Marc opens the chat
=> the unread counter is 1 and cannot be removed

This happens because when a message is deleted, there's still a
trace of it but the message is empty. However, empty messages could
not be candidate of setting the last message being seing by a member,
thus members were unable to mark the chat as read until someone else
posted a newer message (and did not delete it).

This commit fixes the issue by taking empty messages into account for
setting last message message of member, which allow to mark thread as
read even when newer messages have been deleted.

opw-3764410

closes #159362

X-original-commit: 7c7634e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
robodoo pushed a commit that referenced this pull request Mar 28, 2024
Before this commit, when a user of in chat posted a message and
deleted it, all other users kept the chat as unread.

Steps to reproduce:
- Connect as Admin and March Demo
- Send a message to Admin as Demo in DM chat
- Demo deletes this message
- Marc opens the chat
=> the unread counter is 1 and cannot be removed

This happens because when a message is deleted, there's still a
trace of it but the message is empty. However, empty messages could
not be candidate of setting the last message being seing by a member,
thus members were unable to mark the chat as read until someone else
posted a newer message (and did not delete it).

This commit fixes the issue by taking empty messages into account for
setting last message message of member, which allow to mark thread as
read even when newer messages have been deleted.

opw-3764410

closes #159362

X-original-commit: 7c7634e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
robodoo pushed a commit that referenced this pull request Mar 28, 2024
Before this commit, when a user of in chat posted a message and
deleted it, all other users kept the chat as unread.

Steps to reproduce:
- Connect as Admin and March Demo
- Send a message to Admin as Demo in DM chat
- Demo deletes this message
- Marc opens the chat
=> the unread counter is 1 and cannot be removed

This happens because when a message is deleted, there's still a
trace of it but the message is empty. However, empty messages could
not be candidate of setting the last message being seing by a member,
thus members were unable to mark the chat as read until someone else
posted a newer message (and did not delete it).

This commit fixes the issue by taking empty messages into account for
setting last message message of member, which allow to mark thread as
read even when newer messages have been deleted.

opw-3764410

closes #159362

X-original-commit: 7c7634e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
robodoo pushed a commit that referenced this pull request Mar 28, 2024
Before this commit, when a user of in chat posted a message and
deleted it, all other users kept the chat as unread.

Steps to reproduce:
- Connect as Admin and March Demo
- Send a message to Admin as Demo in DM chat
- Demo deletes this message
- Marc opens the chat
=> the unread counter is 1 and cannot be removed

This happens because when a message is deleted, there's still a
trace of it but the message is empty. However, empty messages could
not be candidate of setting the last message being seing by a member,
thus members were unable to mark the chat as read until someone else
posted a newer message (and did not delete it).

This commit fixes the issue by taking empty messages into account for
setting last message message of member, which allow to mark thread as
read even when newer messages have been deleted.

opw-3764410

closes #159362

X-original-commit: 7c7634e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@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-17.0-fix-chat-deleted-message-counter-aku-cbmD-fw branch April 12, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17.3 conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants