Skip double save with sync message that has errors

This commit is contained in:
Evan Hahn 2021-06-28 18:04:42 -05:00 committed by GitHub
parent 4495a1ac67
commit a3315bcb68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1742,7 +1742,8 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
}); });
} catch (result) { } catch (result) {
const errors = (result && result.errors) || [new Error('Unknown error')]; const errors = (result && result.errors) || [new Error('Unknown error')];
this.saveErrors(errors); // We don't save because we're about to save below.
this.saveErrors(errors, { skipSave: true });
} finally { } finally {
await window.Signal.Data.saveMessage(this.attributes, { await window.Signal.Data.saveMessage(this.attributes, {
Message: window.Whisper.Message, Message: window.Whisper.Message,