From dd233bd40e8ac85c0678158feb83b2a7d6aaa21a Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 29 Jun 2016 09:00:45 +0200 Subject: [PATCH] [FIX] mail: message order It might happen that a transaction produces more than one message in the chatter. In this case, the messages are created with the exact same date, and they might appear in the wrong order in the chatter. We therefore sort the messages by id, and not by date. Note that the messages are already sorted when received from the server, but the web client has its own management of the messages' order. Relying on the server order might imply to change other parts of the code on client side, which is something we want to avoid on a stable version. opw-681049 --- addons/mail/static/src/js/chat_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index 54eaf637ff8..78f5547e6c8 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -459,7 +459,7 @@ function fetch_document_messages (ids, options) { processed_msgs.push(add_message(msg, {silent: true})); }); return _.sortBy(loaded_msgs.concat(processed_msgs), function (msg) { - return msg.date; + return msg.id; }); }); } else {