diff options
Diffstat (limited to 'addons/mail/static/src/models/messaging_notification_handler')
| -rw-r--r-- | addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js index f92521f248e..86cd5919b53 100644 --- a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js +++ b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js @@ -530,12 +530,20 @@ function factory(dependencies) { // 1. move messages from inbox to history // AKU TODO: flag other caches to invalidate // task-2171873 - inboxMailbox.messages.map(message => { - message.update({ - isNeedaction: false, - isHistory: true, - }); - }); + for (const message_id of message_ids) { + // We need to ignore all not yet known messages because we don't want them + // to be shown partially as they would be linked directly to mainCache + // Furthermore, server should not send back all message_ids marked as read + // but something like last read message_id or something like that. + // (just imagine you mark 1000 messages as read ... ) + const message = this.env.models['mail.message'].find(m => m.id === message_id); + if (message) { + message.update({ + isNeedaction: false, + isHistory: true, + }); + } + } // 2. remove "needaction" from channels let channels; |
