Fix race between sync messages and receipts
Previously, when processing a backlog of sync messages and their delivery receipts, we would fail to mark some messages as delivered even though we got a receipt. This was due to an async race condition between saving a sync message and fetching it after the receipt arrives. Fix by re-ordering idb requests such that we save the message first and fetch it after. Fixes #479 // FREEBIE
This commit is contained in:
@@ -352,8 +352,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
conversation.save().then(function() {
|
||||
message.save().then(function() {
|
||||
message.save().then(function() {
|
||||
conversation.save().then(function() {
|
||||
conversation.trigger('newmessage', message);
|
||||
conversation.notify(message);
|
||||
});
|
||||
|
Reference in New Issue
Block a user