Fix phantom outgoing messages
This bug was caused by a race between indexeddb requests and sending messages. Order of events to repro was roughly: 1. send async idb request for current message list 2. add new message(s) 3. idb request returns with now incomplete message list 4. message collection gets reset to list from 3, removing messages added in 2, but not removing their phantom views/dom elements. (bug) 5. send another idb request for current message list 6. idb request returns bearing all messages including those from 2. 7. messages from 2 are added and rendered a second time. The fix was simply to not remove messages in 4, which means we reuse the original message model object rather than recreating it in 7. Fixes #243 // FREEBIE
This commit is contained in:
parent
fa4022a4e3
commit
cfc3b8e6a5
1 changed files with 1 additions and 1 deletions
|
@ -259,7 +259,7 @@
|
|||
},
|
||||
|
||||
fetchConversation: function(conversationId) {
|
||||
var options = {};
|
||||
var options = {remove: false};
|
||||
options.index = {
|
||||
// 'conversation' index on [conversationId, received_at]
|
||||
name : 'conversation',
|
||||
|
|
Loading…
Reference in a new issue