[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
This commit is contained in:
Nicolas Martinelli
2016-06-29 10:23:29 +02:00
parent 1d843884e8
commit dd233bd40e
+1 -1
View File
@@ -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 {