wire-ios
wire-ios copied to clipboard
fix: duplicate message - WPB-11435
|
|
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
isProcessingso we don't process twice the same event.
Testing
- on a conversation, run web spam messages
- 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.