Fix race condition: Pull from database after add to conversation

Also add some console logs to help us determine whether this ever
happens to people in the wild.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-05-26 15:33:50 -07:00
parent e9152d9d27
commit 10c2874d19
2 changed files with 20 additions and 4 deletions

View file

@ -303,6 +303,9 @@
var read = unreadMessages.map(function(m) {
if (this.messageCollection.get(m.id)) {
m = this.messageCollection.get(m.id);
} else {
console.log('Marked a message as read in the database, but ' +
'it was not in messageCollection.');
}
m.markRead();
return {