wire-ios icon indicating copy to clipboard operation
wire-ios copied to clipboard

fix: duplicate message - WPB-11435

Open netbe opened this issue 8 months ago • 3 comments

BugWPB-11435 [iOS] All messages in a 1:1 conversation duplicated in iOS

Issue

On the legacy code, it happens message get processed multiple times. It could be that in the following recursive method, because of a suspension point, the fetchNextEventsBatch fetch the same event before we actually delete it from the database and so reprocess it.

  private func process(
        with privateKeys: EARPrivateKeys?,
        _ consumeBlock: ConsumeBlock,
        firstCall: Bool,
        callEventsOnly: Bool
  • Make EventDecoder an actor so it's always executed on the same queue.
  • Safe guard the method with isProcessing so we don't process twice the same event.

Testing

  1. on a conversation, run web spam messages
  2. on the receiver side, send messages

Actual: You'll see duplicate messages

Fix: You'll get no duplicate messages


Checklist

  • [ ] Title contains a reference JIRA issue number like [WPB-XXX].
  • [ ] Description is filled and free of optional paragraphs.
  • [ ] Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • [ ] Make sure you use the API for UI elements that support large fonts.
  • [ ] All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • [ ] New UI elements have Accessibility strings for VoiceOver.

netbe avatar Mar 10 '25 16:03 netbe