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.
|
||||
const inMemoryMessage = window.MessageController.findBySender(
|
||||
this.getSenderIdentifier()
|
||||
);
|
||||
)?.attributes;
|
||||
if (inMemoryMessage) {
|
||||
log.info(
|
||||
`handleDataMessage/${idLog}: cache hit`,
|
||||
|
@ -2090,7 +2090,14 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
inMemoryMessage || (await getMessageBySender(this.attributes));
|
||||
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(
|
||||
`handleDataMessage/${idLog}: Received duplicate message`,
|
||||
this.idForLogging()
|
||||
|
|
|
@ -2616,6 +2616,10 @@ export default class MessageReceiver
|
|||
return;
|
||||
}
|
||||
|
||||
log.info(
|
||||
'MessageReceiver.handleSyncMessage: handling storyMessageRecipients isRecipientUpdate sync message',
|
||||
getEnvelopeId(envelope)
|
||||
);
|
||||
const ev = new StoryRecipientUpdateEvent(
|
||||
{
|
||||
destinationUuid: envelope.destinationUuid.toString(),
|
||||
|
|
Loading…
Reference in a new issue