Capture id after first save for incoming error messages

This commit is contained in:
Scott Nonnenberg 2019-06-24 11:47:43 -07:00 committed by Ken Powers
parent 48691a2558
commit d97dae6a87

View file

@ -1639,10 +1639,15 @@
return; return;
} }
const id = await window.Signal.Data.saveMessage(message.attributes, {
Message: Whisper.Message,
});
message.set({ id });
await message.saveErrors(error || new Error('Error was null')); await message.saveErrors(error || new Error('Error was null'));
const id = message.get('conversationId');
const conversationId = message.get('conversationId');
const conversation = await ConversationController.getOrCreateAndWait( const conversation = await ConversationController.getOrCreateAndWait(
id, conversationId,
'private' 'private'
); );
conversation.set({ conversation.set({
@ -1663,9 +1668,13 @@
ev.confirm(); ev.confirm();
} }
await window.Signal.Data.updateConversation(id, conversation.attributes, { await window.Signal.Data.updateConversation(
Conversation: Whisper.Conversation, conversationId,
}); conversation.attributes,
{
Conversation: Whisper.Conversation,
}
);
} }
throw error; throw error;