Don't add duplicate errors to the database
This commit is contained in:
parent
26a3342d2a
commit
8c365b1a3a
1 changed files with 8 additions and 0 deletions
|
@ -1403,6 +1403,14 @@
|
||||||
}
|
}
|
||||||
const envelope = ev.proto;
|
const envelope = ev.proto;
|
||||||
const message = await initIncomingMessage(envelope, { isError: true });
|
const message = await initIncomingMessage(envelope, { isError: true });
|
||||||
|
const isDuplicate = await isMessageDuplicate(message);
|
||||||
|
if (isDuplicate) {
|
||||||
|
ev.confirm();
|
||||||
|
window.log.warn(
|
||||||
|
`Got duplicate error for message ${message.idForLogging()}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await message.saveErrors(error || new Error('Error was null'));
|
await message.saveErrors(error || new Error('Error was null'));
|
||||||
const id = message.get('conversationId');
|
const id = message.get('conversationId');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue