From fe8ef21659c14b9b34fa8fdf0dd999f3bab99b44 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 8 Apr 2021 20:51:39 +0200 Subject: [PATCH 01/60] Fix memory leak in [RecentsDataSource dataSource:didStateChange:] The block passed into `[MXSession listenToEventsOfTypes:onEvent:]` is stored with a strong reference in the `listenerBlock` property of `MXSessionEventListener`. The method also returns the listener and it is then stored into the `roomTagsListenerByUserId` dictionary on `self`. Since a strong reference to `self` is captured in the block that means the block retains `self` (via the capture) and `self` retains the block (via `roomTagsListenerByUserId`) so there is a memory leak. The bug is most easily reproduced during testing #4168 which involves closing the current and creating a new session. Signed-off-by: Johannes Marbach --- CHANGES.rst | 1 + Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 76bb579d0..363aaaa66 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -23,6 +23,7 @@ Changes to be released in next version * Black theme uses dark background for composer (#4192) * Vertical layout of typing notifs can go wonky (#4159) * Crash in [RoomViewController refreshTypingNotification] (#4161) + * Memory leak in [RecentsDataSource dataSource:didStateChange:] ⚠️ API Changes * diff --git a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m index 497f80fce..09989ec36 100644 --- a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m +++ b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m @@ -337,9 +337,12 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou if ((aState == MXKDataSourceStateReady) && dataSource.mxSession.myUser.userId) { // Register the room tags updates to refresh the favorites order + MXWeakify(self); id roomTagsListener = [dataSource.mxSession listenToEventsOfTypes:@[kMXEventTypeStringRoomTag] onEvent:^(MXEvent *event, MXTimelineDirection direction, id customObject) { + MXStrongifyAndReturnIfNil(self); + // Consider only live event if (direction == MXTimelineDirectionForwards) { From 7ad705d92de9fa82d845ee6cafc66990edb57c46 Mon Sep 17 00:00:00 2001 From: Paulo Pinto Date: Wed, 14 Jul 2021 12:42:27 +0100 Subject: [PATCH 02/60] Standardise casing of identity server Signed-off-by: Paulo Pinto --- Riot/Generated/Strings.swift | 4 ++-- Riot/Modules/Application/LegacyAppDelegate.m | 2 +- Riot/Modules/Authentication/AuthenticationViewController.xib | 2 +- .../SettingsIdentityServerViewController.storyboard | 2 +- Riot/Modules/Settings/SettingsViewController.m | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index e568cf7a8..2c7b1c79b 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -1590,7 +1590,7 @@ internal enum VectorL10n { internal static var identityServerSettingsPlaceHolder: String { return VectorL10n.tr("Vector", "identity_server_settings_place_holder") } - /// Identity Server + /// Identity server internal static var identityServerSettingsTitle: String { return VectorL10n.tr("Vector", "identity_server_settings_title") } @@ -4150,7 +4150,7 @@ internal enum VectorL10n { internal static var settingsDiscoverySettings: String { return VectorL10n.tr("Vector", "settings_discovery_settings") } - /// Agree to the Identity Server (%@) Terms of Service to allow yourself to be discoverable by email address or phone number. + /// Agree to the identity server (%@) Terms of Service to allow yourself to be discoverable by email address or phone number. internal static func settingsDiscoveryTermsNotSigned(_ p1: String) -> String { return VectorL10n.tr("Vector", "settings_discovery_terms_not_signed", p1) } diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index a6df6cb48..73cad0071 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -1164,7 +1164,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni return YES; } - // Manage email validation link from Identity Server v1 or v2 + // Manage email validation link from identity server v1 or v2 else if ([webURL.path isEqualToString:validateEmailSubmitTokenAPIPathV1] || [webURL.path isEqualToString:validateEmailSubmitTokenAPIPathV2]) { diff --git a/Riot/Modules/Authentication/AuthenticationViewController.xib b/Riot/Modules/Authentication/AuthenticationViewController.xib index c654446fc..4080c755d 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.xib +++ b/Riot/Modules/Authentication/AuthenticationViewController.xib @@ -294,7 +294,7 @@ - @@ -86,16 +82,6 @@ - - - - - - - - - - diff --git a/changelog.d/4935.change b/changelog.d/4935.change new file mode 100644 index 000000000..93c0dcc9c --- /dev/null +++ b/changelog.d/4935.change @@ -0,0 +1 @@ +Voice Message scrubbing should require a slightly longer press, to avoid accidental scrubbing when scrolling the timeline \ No newline at end of file From 625b9902d896682ae15ba46c023c299060e364a4 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 8 Oct 2021 15:56:05 +0300 Subject: [PATCH 57/60] Fixes #4970 - Fixed unintentional voice message drafts on automatically cancelled recordings. --- .../VoiceMessageController.swift | 22 ++++++++++++++----- changelog.d/4970.bugfix | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 changelog.d/4970.bugfix diff --git a/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift b/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift index 5d1d48254..01a57e742 100644 --- a/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift +++ b/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift @@ -130,12 +130,7 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate, } func voiceMessageToolbarViewDidRequestRecordingCancel(_ toolbarView: VoiceMessageToolbarView) { - isInLockedMode = false - audioPlayer?.stop() - audioRecorder?.stopRecording() - deleteRecordingAtURL(temporaryFileURL) - UINotificationFeedbackGenerator().notificationOccurred(.error) - updateUI() + cancelRecording() } func voiceMessageToolbarViewDidRequestLockedModeRecording(_ toolbarView: VoiceMessageToolbarView) { @@ -259,6 +254,8 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate, guard isInLockedMode else { if recordDuration ?? 0 >= Constants.minimumRecordingDuration { sendRecordingAtURL(temporaryFileURL) + } else { + cancelRecording() } return } @@ -268,6 +265,19 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate, updateUI() } + private func cancelRecording() { + isInLockedMode = false + + audioPlayer?.stop() + audioRecorder?.stopRecording() + + deleteRecordingAtURL(temporaryFileURL) + + UINotificationFeedbackGenerator().notificationOccurred(.error) + + updateUI() + } + private func loadDraftRecording() { guard let temporaryFileURL = temporaryFileURL, let roomId = roomId else { diff --git a/changelog.d/4970.bugfix b/changelog.d/4970.bugfix new file mode 100644 index 000000000..365cf4aee --- /dev/null +++ b/changelog.d/4970.bugfix @@ -0,0 +1 @@ +Fixed unintentional voice message drafts on automatically cancelled recordings (under 1 second) \ No newline at end of file From a7b482aa8b4a04a1db91f55fdffd5ec9a7cf735d Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 8 Oct 2021 17:04:44 +0200 Subject: [PATCH 58/60] changelog.d: Upgrade MatrixKit version ([v0.16.5](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.5)). --- Podfile | 2 +- changelog.d/x-nolink-0.change | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/x-nolink-0.change diff --git a/Podfile b/Podfile index b06b5f92b..49dec32b5 100644 --- a/Podfile +++ b/Podfile @@ -13,7 +13,7 @@ use_frameworks! # - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -$matrixKitVersion = '= 0.16.4' +$matrixKitVersion = '= 0.16.5' # $matrixKitVersion = :local # $matrixKitVersion = {'develop' => 'develop'} diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change new file mode 100644 index 000000000..a9359bea0 --- /dev/null +++ b/changelog.d/x-nolink-0.change @@ -0,0 +1 @@ +Upgrade MatrixKit version ([v0.16.5](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.5)). \ No newline at end of file From a0aca6a1693b39385b2453283a7c2717f1f536cc Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 8 Oct 2021 17:04:44 +0200 Subject: [PATCH 59/60] version++ --- CHANGES.md | 28 ++++++++++++++++++++++++++++ changelog.d/4559.bugfix | 1 - changelog.d/4896.change | 1 - changelog.d/4898.bugfix | 1 - changelog.d/4899.change | 1 - changelog.d/4920.doc | 1 - changelog.d/4935.change | 1 - changelog.d/4937.build | 1 - changelog.d/4939.change | 1 - changelog.d/4951.build | 1 - changelog.d/4955.change | 1 - changelog.d/4970.bugfix | 1 - changelog.d/pr-4193.bugfix | 1 - changelog.d/x-nolink-0.change | 1 - 14 files changed, 28 insertions(+), 13 deletions(-) delete mode 100644 changelog.d/4559.bugfix delete mode 100644 changelog.d/4896.change delete mode 100644 changelog.d/4898.bugfix delete mode 100644 changelog.d/4899.change delete mode 100644 changelog.d/4920.doc delete mode 100644 changelog.d/4935.change delete mode 100644 changelog.d/4937.build delete mode 100644 changelog.d/4939.change delete mode 100644 changelog.d/4951.build delete mode 100644 changelog.d/4955.change delete mode 100644 changelog.d/4970.bugfix delete mode 100644 changelog.d/pr-4193.bugfix delete mode 100644 changelog.d/x-nolink-0.change diff --git a/CHANGES.md b/CHANGES.md index 7ace58680..ecde7c1af 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,31 @@ +## Changes in 1.6.2 (2021-10-08) + +🙌 Improvements + +- Upgrade MatrixKit version ([v0.16.5](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.5)). +- URL Previews: Use attributed string whitespace for cell heights and stop breaking up the bubble data. ([#4896](https://github.com/vector-im/element-ios/issues/4896)) +- Replaced localizable strings with generated ones throughout the code. Fixed various translation issues. ([#4899](https://github.com/vector-im/element-ios/issues/4899)) +- Voice Message scrubbing should require a slightly longer press, to avoid accidental scrubbing when scrolling the timeline ([#4935](https://github.com/vector-im/element-ios/issues/4935)) +- Pods: Update ffmpeg-kit-ios-audio, FLEX, FlowCommoniOS, Reusable and SwiftLint. ([#4939](https://github.com/vector-im/element-ios/issues/4939)) +- Service Terms: Track an analytics value on accept/decline of an identity server. ([#4955](https://github.com/vector-im/element-ios/issues/4955)) + +🐛 Bugfixes + +- RecentsDataSource: Memory leak in [RecentsDataSource dataSource:didStateChange:]. ([#4193](https://github.com/vector-im/element-ios/pull/4193)) +- i18n: Standardise casing of identity server and integration manager. ([#4559](https://github.com/vector-im/element-ios/issues/4559)) +- MasterTabBarController: Listen to `MXSpaceNotificationCounter` to update the notification badge ([#4898](https://github.com/vector-im/element-ios/issues/4898)) +- Fixed unintentional voice message drafts on automatically cancelled recordings (under 1 second) ([#4970](https://github.com/vector-im/element-ios/issues/4970)) + +🧱 Build + +- Element Alpha: Build on macOS 11 to fix iOS 15 installation error. ([#4937](https://github.com/vector-im/element-ios/issues/4937)) +- Bundler: Update CocoaPods and fastlane and xcode-install. ([#4951](https://github.com/vector-im/element-ios/issues/4951)) + +📄 Documentation + +- Update PR template with a checkbox for accessibility and self review. ([#4920](https://github.com/vector-im/element-ios/issues/4920)) + + ## Changes in 1.6.1 (2021-09-30) 🙌 Improvements diff --git a/changelog.d/4559.bugfix b/changelog.d/4559.bugfix deleted file mode 100644 index 1e0688197..000000000 --- a/changelog.d/4559.bugfix +++ /dev/null @@ -1 +0,0 @@ -i18n: Standardise casing of identity server and integration manager. \ No newline at end of file diff --git a/changelog.d/4896.change b/changelog.d/4896.change deleted file mode 100644 index 00f6d5b4e..000000000 --- a/changelog.d/4896.change +++ /dev/null @@ -1 +0,0 @@ -URL Previews: Use attributed string whitespace for cell heights and stop breaking up the bubble data. \ No newline at end of file diff --git a/changelog.d/4898.bugfix b/changelog.d/4898.bugfix deleted file mode 100644 index 0f4c5faf1..000000000 --- a/changelog.d/4898.bugfix +++ /dev/null @@ -1 +0,0 @@ -MasterTabBarController: Listen to `MXSpaceNotificationCounter` to update the notification badge \ No newline at end of file diff --git a/changelog.d/4899.change b/changelog.d/4899.change deleted file mode 100644 index b53120223..000000000 --- a/changelog.d/4899.change +++ /dev/null @@ -1 +0,0 @@ -Replaced localizable strings with generated ones throughout the code. Fixed various translation issues. \ No newline at end of file diff --git a/changelog.d/4920.doc b/changelog.d/4920.doc deleted file mode 100644 index 746bc48aa..000000000 --- a/changelog.d/4920.doc +++ /dev/null @@ -1 +0,0 @@ -Update PR template with a checkbox for accessibility and self review. \ No newline at end of file diff --git a/changelog.d/4935.change b/changelog.d/4935.change deleted file mode 100644 index 93c0dcc9c..000000000 --- a/changelog.d/4935.change +++ /dev/null @@ -1 +0,0 @@ -Voice Message scrubbing should require a slightly longer press, to avoid accidental scrubbing when scrolling the timeline \ No newline at end of file diff --git a/changelog.d/4937.build b/changelog.d/4937.build deleted file mode 100644 index 2e67b1197..000000000 --- a/changelog.d/4937.build +++ /dev/null @@ -1 +0,0 @@ -Element Alpha: Build on macOS 11 to fix iOS 15 installation error. diff --git a/changelog.d/4939.change b/changelog.d/4939.change deleted file mode 100644 index aed2767eb..000000000 --- a/changelog.d/4939.change +++ /dev/null @@ -1 +0,0 @@ -Pods: Update ffmpeg-kit-ios-audio, FLEX, FlowCommoniOS, Reusable and SwiftLint. \ No newline at end of file diff --git a/changelog.d/4951.build b/changelog.d/4951.build deleted file mode 100644 index 6e7d3ab86..000000000 --- a/changelog.d/4951.build +++ /dev/null @@ -1 +0,0 @@ -Bundler: Update CocoaPods and fastlane and xcode-install. \ No newline at end of file diff --git a/changelog.d/4955.change b/changelog.d/4955.change deleted file mode 100644 index ef63ba876..000000000 --- a/changelog.d/4955.change +++ /dev/null @@ -1 +0,0 @@ -Service Terms: Track an analytics value on accept/decline of an identity server. \ No newline at end of file diff --git a/changelog.d/4970.bugfix b/changelog.d/4970.bugfix deleted file mode 100644 index 365cf4aee..000000000 --- a/changelog.d/4970.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed unintentional voice message drafts on automatically cancelled recordings (under 1 second) \ No newline at end of file diff --git a/changelog.d/pr-4193.bugfix b/changelog.d/pr-4193.bugfix deleted file mode 100644 index 10e269cb8..000000000 --- a/changelog.d/pr-4193.bugfix +++ /dev/null @@ -1 +0,0 @@ -RecentsDataSource: Memory leak in [RecentsDataSource dataSource:didStateChange:]. \ No newline at end of file diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change deleted file mode 100644 index a9359bea0..000000000 --- a/changelog.d/x-nolink-0.change +++ /dev/null @@ -1 +0,0 @@ -Upgrade MatrixKit version ([v0.16.5](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.5)). \ No newline at end of file From 0e77f50fbfb4b139ad69648fb1cac19c4e5b869a Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 8 Oct 2021 17:51:15 +0200 Subject: [PATCH 60/60] finish version++ --- Podfile.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 27e8a2ced..4a7bfb316 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -45,7 +45,7 @@ PODS: - GBDeviceInfo/Core (6.6.0) - GZIP (1.3.0) - HPGrowingTextView (1.1) - - JitsiMeetSDK (3.5.0) + - JitsiMeetSDK (3.10.2) - KeychainAccess (4.2.2) - KituraContracts (1.2.1): - LoggerAPI (~> 1.7) @@ -58,30 +58,30 @@ PODS: - MatomoTracker (7.4.1): - MatomoTracker/Core (= 7.4.1) - MatomoTracker/Core (7.4.1) - - MatrixKit (0.16.4): + - MatrixKit (0.16.5): - Down (~> 0.11.0) - DTCoreText (~> 1.6.25) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixKit/Core (= 0.16.4) - - MatrixSDK (= 0.20.4) - - MatrixKit/Core (0.16.4): + - MatrixKit/Core (= 0.16.5) + - MatrixSDK (= 0.20.5) + - MatrixKit/Core (0.16.5): - Down (~> 0.11.0) - DTCoreText (~> 1.6.25) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.20.4) - - MatrixSDK (0.20.4): - - MatrixSDK/Core (= 0.20.4) - - MatrixSDK/Core (0.20.4): + - MatrixSDK (= 0.20.5) + - MatrixSDK (0.20.5): + - MatrixSDK/Core (= 0.20.5) + - MatrixSDK/Core (0.20.5): - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - OLMKit (~> 3.2.5) - - Realm (= 10.7.6) + - Realm (= 10.16.0) - SwiftyBeaver (= 1.9.5) - - MatrixSDK/JingleCallStack (0.20.4): - - JitsiMeetSDK (= 3.5.0) + - MatrixSDK/JingleCallStack (0.20.5): + - JitsiMeetSDK (= 3.10.2) - MatrixSDK/Core - OLMKit (3.2.5): - OLMKit/olmc (= 3.2.5) @@ -89,9 +89,9 @@ PODS: - OLMKit/olmc (3.2.5) - OLMKit/olmcpp (3.2.5) - ReadMoreTextView (3.0.1) - - Realm (10.7.6): - - Realm/Headers (= 10.7.6) - - Realm/Headers (10.7.6) + - Realm (10.16.0): + - Realm/Headers (= 10.16.0) + - Realm/Headers (10.16.0) - Reusable (4.1.2): - Reusable/Storyboard (= 4.1.2) - Reusable/View (= 4.1.2) @@ -124,7 +124,7 @@ DEPENDENCIES: - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) - MatomoTracker (~> 7.4.1) - - MatrixKit (= 0.16.4) + - MatrixKit (= 0.16.5) - MatrixSDK - MatrixSDK/JingleCallStack - OLMKit @@ -195,7 +195,7 @@ SPEC CHECKSUMS: GBDeviceInfo: ed0db16230d2fa280e1cbb39a5a7f60f6946aaec GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3 HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19 - JitsiMeetSDK: ef6ebbad2237c0e3ea6ff61fea78745f9543b238 + JitsiMeetSDK: 2f118fa770f23e518f3560fc224fae3ac7062223 KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51 KituraContracts: e845e60dc8627ad0a76fa55ef20a45451d8f830b KTCenterFlowLayout: 6e02b50ab2bd865025ae82fe266ed13b6d9eaf97 @@ -204,11 +204,11 @@ SPEC CHECKSUMS: LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b MatomoTracker: 24a846c9d3aa76933183fe9d47fd62c9efa863fb - MatrixKit: e2836912d2dc2072a276526e92679d094b2bd6b5 - MatrixSDK: 317928f6ef7bbffebbf7dbf9ca9dad4920695f1e + MatrixKit: a37efb94bb7c53b5dc912f0fd35971861b6c28bf + MatrixSDK: 417fac309f510b5f8ac121ba8abe3b897953e1ce OLMKit: 9fb4799c4a044dd2c06bda31ec31a12191ad30b5 ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d - Realm: ed860452717c8db8f4bf832b6807f7f2ce708839 + Realm: b6027801398f3743fc222f096faa85281b506e6c Reusable: 6bae6a5e8aa793c9c441db0213c863a64bce9136 SideMenu: f583187d21c5b1dd04c72002be544b555a2627a2 SwiftBase32: 9399c25a80666dc66b51e10076bf591e3bbb8f17 @@ -219,6 +219,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 367d7a514c7d8ea3cc4b0adb5878c8a192c7c2c8 +PODFILE CHECKSUM: e189a08f2a6f081d6eb0f57aaa898833f27a9adb -COCOAPODS: 1.10.1 +COCOAPODS: 1.11.2