Drop duplicate stories
This commit is contained in:
parent
c3bb3b152e
commit
3af478837d
2 changed files with 13 additions and 2 deletions
|
@ -2074,7 +2074,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
// First, check for duplicates. If we find one, stop processing here.
|
// First, check for duplicates. If we find one, stop processing here.
|
||||||
const inMemoryMessage = window.MessageController.findBySender(
|
const inMemoryMessage = window.MessageController.findBySender(
|
||||||
this.getSenderIdentifier()
|
this.getSenderIdentifier()
|
||||||
);
|
)?.attributes;
|
||||||
if (inMemoryMessage) {
|
if (inMemoryMessage) {
|
||||||
log.info(
|
log.info(
|
||||||
`handleDataMessage/${idLog}: cache hit`,
|
`handleDataMessage/${idLog}: cache hit`,
|
||||||
|
@ -2090,7 +2090,14 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
inMemoryMessage || (await getMessageBySender(this.attributes));
|
inMemoryMessage || (await getMessageBySender(this.attributes));
|
||||||
const isUpdate = Boolean(data && data.isRecipientUpdate);
|
const isUpdate = Boolean(data && data.isRecipientUpdate);
|
||||||
|
|
||||||
if (existingMessage && type === 'incoming') {
|
const isDuplicateMessage =
|
||||||
|
existingMessage &&
|
||||||
|
(type === 'incoming' ||
|
||||||
|
(type === 'story' &&
|
||||||
|
existingMessage.storyDistributionListId ===
|
||||||
|
this.attributes.storyDistributionListId));
|
||||||
|
|
||||||
|
if (isDuplicateMessage) {
|
||||||
log.warn(
|
log.warn(
|
||||||
`handleDataMessage/${idLog}: Received duplicate message`,
|
`handleDataMessage/${idLog}: Received duplicate message`,
|
||||||
this.idForLogging()
|
this.idForLogging()
|
||||||
|
|
|
@ -2616,6 +2616,10 @@ export default class MessageReceiver
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
'MessageReceiver.handleSyncMessage: handling storyMessageRecipients isRecipientUpdate sync message',
|
||||||
|
getEnvelopeId(envelope)
|
||||||
|
);
|
||||||
const ev = new StoryRecipientUpdateEvent(
|
const ev = new StoryRecipientUpdateEvent(
|
||||||
{
|
{
|
||||||
destinationUuid: envelope.destinationUuid.toString(),
|
destinationUuid: envelope.destinationUuid.toString(),
|
||||||
|
|
Loading…
Reference in a new issue