mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Drop duplicate stories
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user