[FIX] mail: message not found
message_ids contains the ids of all the messages. However, a maximum of 100 messages are fetched when a page is open, and therefore some messages might not be found in the JS cache. This leads to message.is_needaction throwing an exception. This fix returns True if the message is not found. It means that the message will be set as 'read' even if it is not displayed. opw-657896
This commit is contained in:
@@ -557,7 +557,8 @@ var chat_manager = {
|
||||
mark_as_read: function (message_ids) {
|
||||
var ids = _.filter(message_ids, function (id) {
|
||||
var message = _.findWhere(messages, {id: id});
|
||||
return message.is_needaction;
|
||||
// If too many messages, not all are fetched, and some might not be found
|
||||
return !message || message.is_needaction;
|
||||
});
|
||||
if (ids.length) {
|
||||
return MessageModel.call('set_message_done', [ids]);
|
||||
|
||||
Reference in New Issue
Block a user