From f437ffa006a2037481f883c9b4e373e47966cd56 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 4 Jul 2018 09:42:00 +0200 Subject: [PATCH 1/2] RoomVC: Fix duplication of read receipts Regression due to read receipt perf improvement. Disable the optimisation with `foundSenders` because the assumption "As there is one (the last) read receipt displayed per user" was wrong for internal processing data. --- CHANGES.rst | 8 ++++++++ Riot/Model/Room/RoomDataSource.m | 25 ++++--------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8cdeb7417..4985c84b2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,11 @@ +Changes in 0.6.19 (2018-07-04) +=============================================== + +Improvements: + +Bug fix: +* RoomVC: Fix duplicated read receipts (regression due to read receipts performance improvement). + Changes in 0.6.18 (2018-07-03) =============================================== diff --git a/Riot/Model/Room/RoomDataSource.m b/Riot/Model/Room/RoomDataSource.m index 436405d0d..2586ed0c2 100644 --- a/Riot/Model/Room/RoomDataSource.m +++ b/Riot/Model/Room/RoomDataSource.m @@ -103,26 +103,23 @@ // new read receipt. // To implement it, we need to find the sender id of each new read receipt // among the read receipts array of all events in all bubbles. - NSMutableArray *readReceiptSenders = [receiptEvent.readReceiptSenders mutableCopy]; + NSArray *readReceiptSenders = receiptEvent.readReceiptSenders; @synchronized(bubbles) { - NSMutableDictionary *> *updatedCellDataReadReceipts = [NSMutableDictionary dictionary]; for (RoomBubbleCellData *cellData in bubbles) { + NSMutableDictionary *> *updatedCellDataReadReceipts = [NSMutableDictionary dictionary]; + for (NSString *eventId in cellData.readReceipts) { for (MXReceiptData *receiptData in cellData.readReceipts[eventId]) { - NSMutableArray *foundSenders = [NSMutableArray array]; for (NSString *senderId in readReceiptSenders) { if ([receiptData.userId isEqualToString:senderId]) { - // We find an existing displayed receipt, remove it - [foundSenders addObject:senderId]; - - if (!updatedCellDataReadReceipts[eventId]) + if (!updatedCellDataReadReceipts[eventId]) { updatedCellDataReadReceipts[eventId] = cellData.readReceipts[eventId]; } @@ -133,14 +130,6 @@ } } - // As there is one (the last) read receipt displayed per user, - // we do not need to search for other read receipts of found users. - [readReceiptSenders removeObjectsInArray:foundSenders]; - if (!readReceiptSenders.count) - { - // All senders have been found - break; - } } } @@ -156,12 +145,6 @@ cellData.readReceipts[eventId] = nil; } } - - if (!readReceiptSenders.count) - { - // All senders have been found - break; - } } } From 14e40f8062d9c7a0a9d80c1c487e797fe2650ea2 Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Thu, 5 Jul 2018 11:00:17 +0200 Subject: [PATCH 2/2] version++ --- CHANGES.rst | 2 +- Riot/Info.plist | 4 ++-- RiotShareExtension/Info.plist | 14 +++++++------- SiriIntents/Info.plist | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 4985c84b2..6aae592d2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,4 +1,4 @@ -Changes in 0.6.19 (2018-07-04) +Changes in 0.6.19 (2018-07-05) =============================================== Improvements: diff --git a/Riot/Info.plist b/Riot/Info.plist index 8377d7276..f54250fcc 100644 --- a/Riot/Info.plist +++ b/Riot/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.6.18 + 0.6.19 CFBundleSignature ???? CFBundleVersion - 0.6.18 + 0.6.19 ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode diff --git a/RiotShareExtension/Info.plist b/RiotShareExtension/Info.plist index fd320e7e7..c9c3a7a5b 100644 --- a/RiotShareExtension/Info.plist +++ b/RiotShareExtension/Info.plist @@ -17,29 +17,29 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.6.18 + 0.6.19 CFBundleVersion - 1 + 0.6.19 NSExtension - NSExtensionPrincipalClass - SharePresentingViewController NSExtensionAttributes NSExtensionActivationRule - NSExtensionActivationSupportsMovieWithMaxCount - 1 NSExtensionActivationSupportsImageWithMaxCount 5 - NSExtensionActivationSupportsWebURLWithMaxCount + NSExtensionActivationSupportsMovieWithMaxCount 1 NSExtensionActivationSupportsText + NSExtensionActivationSupportsWebURLWithMaxCount + 1 NSExtensionPointIdentifier com.apple.share-services + NSExtensionPrincipalClass + SharePresentingViewController diff --git a/SiriIntents/Info.plist b/SiriIntents/Info.plist index ab1b6d34b..5af508b8b 100644 --- a/SiriIntents/Info.plist +++ b/SiriIntents/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.6.18 + 0.6.19 CFBundleVersion - 1 + 0.6.19 NSExtension NSExtensionAttributes