From 1f8f6ffdf12e0169dcd2d12fb2989bd1376d97c8 Mon Sep 17 00:00:00 2001 From: Flescio Date: Thu, 9 Feb 2023 09:01:16 +0100 Subject: [PATCH 1/6] "Mark as unread" dot appears on rooms that are actually unread, not marked as such (#7352) * fix green dot only to appear for marked action --- .../Common/Recents/Views/RecentTableViewCell.m | 15 +++++++++------ .../MatrixKit/Models/RoomList/MXKRecentCellData.m | 8 ++++++-- .../Models/RoomList/MXKRecentCellDataStoring.h | 1 + changelog.d/7530.bugfix | 1 + 4 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 changelog.d/7530.bugfix diff --git a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m index d1ac3d9146..a219963337 100644 --- a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m +++ b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m @@ -92,12 +92,17 @@ - (void)render:(MXKCellData *)cellData self.lastEventDecriptionLabelTrailingConstraint.constant = self.unsentImageView.hidden ? 10 : 30; // Notify unreads and bing - if (roomCellData.hasUnread) + if (roomCellData.isRoomMarkedAsUnread) { - + self.missedNotifAndUnreadBadgeBgView.hidden = NO; + self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.tintColor; + self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = 20; + } + else if (roomCellData.hasUnread) + { + self.missedNotifAndUnreadIndicator.hidden = NO; if (0 < roomCellData.notificationCount) { - self.missedNotifAndUnreadIndicator.hidden = NO; self.missedNotifAndUnreadIndicator.backgroundColor = roomCellData.highlightCount ? ThemeService.shared.theme.noticeColor : ThemeService.shared.theme.noticeSecondaryColor; self.missedNotifAndUnreadBadgeBgView.hidden = NO; @@ -110,9 +115,7 @@ - (void)render:(MXKCellData *)cellData } else { - self.missedNotifAndUnreadBadgeBgView.hidden = NO; - self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.tintColor; - self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = 20; + self.missedNotifAndUnreadIndicator.backgroundColor = ThemeService.shared.theme.unreadRoomIndentColor; } // Use bold font for the room title diff --git a/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellData.m b/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellData.m index 4e6ebbe808..474494d59c 100644 --- a/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellData.m +++ b/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellData.m @@ -63,8 +63,12 @@ - (NSString*)lastEventDate - (BOOL)hasUnread { - bool isRoomUnread = [[self mxSession] isRoomMarkedAsUnread:roomSummary.roomId]; - return (roomSummary.localUnreadEventCount != 0 || isRoomUnread); + return (roomSummary.localUnreadEventCount != 0); +} + +- (BOOL)isRoomMarkedAsUnread +{ + return [[self mxSession] isRoomMarkedAsUnread:roomSummary.roomId];; } - (NSString *)roomIdentifier diff --git a/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h b/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h index 7185ae4eb5..3c417c1faa 100644 --- a/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h +++ b/Riot/Modules/MatrixKit/Models/RoomList/MXKRecentCellDataStoring.h @@ -50,6 +50,7 @@ @property (nonatomic, readonly) NSString *lastEventDate; @property (nonatomic, readonly) BOOL hasUnread; +@property (nonatomic, readonly) BOOL isRoomMarkedAsUnread; @property (nonatomic, readonly) NSUInteger notificationCount; @property (nonatomic, readonly) NSUInteger highlightCount; @property (nonatomic, readonly) NSString *notificationCountStringValue; diff --git a/changelog.d/7530.bugfix b/changelog.d/7530.bugfix new file mode 100644 index 0000000000..7309798a9c --- /dev/null +++ b/changelog.d/7530.bugfix @@ -0,0 +1 @@ +Fixes #7350 - Fix green dot only to appear for marked action \ No newline at end of file From 9be98478db2d82473bd882c941ed40a2d5187ae1 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Wed, 8 Feb 2023 10:39:51 +0000 Subject: [PATCH 2/6] Fix some crashes --- .../AllChats/AllChatsViewController.swift | 28 +++++++++++-------- .../MatrixKit/Models/Room/MXKRoomDataSource.m | 25 +++++++++++++---- .../MXRoomNotificationSettingsService.swift | 18 +++++++----- 3 files changed, 47 insertions(+), 24 deletions(-) diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift index a424c83464..2ec3bbe8b0 100644 --- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift +++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift @@ -196,7 +196,7 @@ class AllChatsViewController: HomeViewController { searchController.isActive = false guard let spaceId = spaceId else { - self.dataSource?.currentSpace = nil + dataSource?.currentSpace = nil updateUI() return @@ -207,7 +207,7 @@ class AllChatsViewController: HomeViewController { return } - self.dataSource.currentSpace = space + dataSource?.currentSpace = space updateUI() self.recentsTableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: true) @@ -288,7 +288,7 @@ class AllChatsViewController: HomeViewController { @objc private func showSpaceSelectorAction(sender: AnyObject) { Analytics.shared.viewRoomTrigger = .roomList - let currentSpaceId = self.dataSource.currentSpace?.spaceId ?? SpaceSelectorConstants.homeSpaceId + let currentSpaceId = dataSource?.currentSpace?.spaceId ?? SpaceSelectorConstants.homeSpaceId let spaceSelectorBridgePresenter = SpaceSelectorBottomSheetCoordinatorBridgePresenter(session: self.mainSession, selectedSpaceId: currentSpaceId, showHomeSpace: true) spaceSelectorBridgePresenter.present(from: self, animated: true) spaceSelectorBridgePresenter.delegate = self @@ -310,7 +310,7 @@ class AllChatsViewController: HomeViewController { return super.tableView(tableView, numberOfRowsInSection: section) } - return dataSource.tableView(tableView, numberOfRowsInSection: section) + return dataSource?.tableView(tableView, numberOfRowsInSection: section) ?? 0 } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { @@ -318,6 +318,10 @@ class AllChatsViewController: HomeViewController { return super.tableView(tableView, cellForRowAt: indexPath) } + guard let dataSource = dataSource else { + MXLog.failure("Missing data source") + return UITableViewCell() + } return dataSource.tableView(tableView, cellForRowAt: indexPath) } @@ -328,7 +332,7 @@ class AllChatsViewController: HomeViewController { return super.tableView(tableView, heightForRowAt: indexPath) } - return dataSource.cellHeight(at: indexPath) + return dataSource?.cellHeight(at: indexPath) ?? 0 } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { @@ -583,7 +587,7 @@ class AllChatsViewController: HomeViewController { } private func showSpaceInvite() { - guard let session = mainSession, let spaceRoom = dataSource.currentSpace?.room else { + guard let session = mainSession, let spaceRoom = dataSource?.currentSpace?.room else { return } @@ -595,7 +599,7 @@ class AllChatsViewController: HomeViewController { } private func showSpaceMembers() { - guard let session = mainSession, let spaceId = dataSource.currentSpace?.spaceId else { + guard let session = mainSession, let spaceId = dataSource?.currentSpace?.spaceId else { return } @@ -609,7 +613,7 @@ class AllChatsViewController: HomeViewController { } private func showSpaceSettings() { - guard let session = mainSession, let spaceId = dataSource.currentSpace?.spaceId else { + guard let session = mainSession, let spaceId = dataSource?.currentSpace?.spaceId else { return } @@ -630,7 +634,7 @@ class AllChatsViewController: HomeViewController { } private func showLeaveSpace() { - guard let session = mainSession, let spaceSummary = dataSource.currentSpace?.summary else { + guard let session = mainSession, let spaceSummary = dataSource?.currentSpace?.summary else { return } @@ -714,11 +718,11 @@ extension AllChatsViewController: SpaceSelectorBottomSheetCoordinatorBridgePrese extension AllChatsViewController: UISearchResultsUpdating { func updateSearchResults(for searchController: UISearchController) { guard let searchText = searchController.searchBar.text, !searchText.isEmpty else { - self.dataSource.search(withPatterns: nil) + self.dataSource?.search(withPatterns: nil) return } - self.dataSource.search(withPatterns: [searchText]) + self.dataSource?.search(withPatterns: [searchText]) } } @@ -754,7 +758,7 @@ extension AllChatsViewController: AllChatsEditActionProviderDelegate { case .startChat: startChat() case .createSpace: - showCreateSpace(parentSpaceId: dataSource.currentSpace?.spaceId) + showCreateSpace(parentSpaceId: dataSource?.currentSpace?.spaceId) } } diff --git a/Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m b/Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m index 5f33af838e..0998122aef 100644 --- a/Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m +++ b/Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m @@ -2150,7 +2150,10 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *) } else { - failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]); + if (failure) + { + failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]); + } MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend room message of type: %@", self, msgType); } } @@ -2177,7 +2180,10 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *) NSURL *localFileURL = [NSURL URLWithString:localFilePath]; if (![NSFileManager.defaultManager fileExistsAtPath:localFilePath]) { - failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidLocalFilePath userInfo:nil]); + if (failure) + { + failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidLocalFilePath userInfo:nil]); + } MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend voice message, invalid file path.", self); return; } @@ -2247,7 +2253,10 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *) } else { - failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]); + if (failure) + { + failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]); + } MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend room message of type: %@", self, msgType); } } @@ -2259,13 +2268,19 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *) } else { - failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]); + if (failure) + { + failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]); + } MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend room message of type: %@", self, msgType); } } else { - failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]); + if (failure) + { + failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]); + } MXLogWarning(@"[MXKRoomDataSource][%p] MXKRoomDataSource: Warning - Only resend of MXEventTypeRoomMessage is allowed. Event.type: %@", self, event.type); } } diff --git a/RiotSwiftUI/Modules/Room/NotificationSettings/Service/MatrixSDK/MXRoomNotificationSettingsService.swift b/RiotSwiftUI/Modules/Room/NotificationSettings/Service/MatrixSDK/MXRoomNotificationSettingsService.swift index e9d192b490..caaa45a530 100644 --- a/RiotSwiftUI/Modules/Room/NotificationSettings/Service/MatrixSDK/MXRoomNotificationSettingsService.swift +++ b/RiotSwiftUI/Modules/Room/NotificationSettings/Service/MatrixSDK/MXRoomNotificationSettingsService.swift @@ -30,6 +30,10 @@ final class MXRoomNotificationSettingsService: RoomNotificationSettingsServiceTy private var observers: [ObjectIdentifier] = [] + private var notificationCenter: MXNotificationCenter? { + room.mxSession?.notificationCenter + } + // MARK: Public var notificationState: RoomNotificationState { @@ -166,7 +170,7 @@ final class MXRoomNotificationSettingsService: RoomNotificationSettingsServiceTy } handleFailureCallback(completion) - room.mxSession.notificationCenter.addRoomRule( + notificationCenter?.addRoomRule( room.roomId, notify: false, sound: false, @@ -184,7 +188,7 @@ final class MXRoomNotificationSettingsService: RoomNotificationSettingsServiceTy } handleFailureCallback(completion) - room.mxSession.notificationCenter.addOverrideRule( + notificationCenter?.addOverrideRule( withId: roomId, conditions: [["kind": "event_match", "key": "room_id", "pattern": roomId]], notify: false, @@ -196,11 +200,11 @@ final class MXRoomNotificationSettingsService: RoomNotificationSettingsServiceTy private func removePushRule(rule: MXPushRule, completion: @escaping Completion) { handleUpdateCallback(completion) { [weak self] in guard let self = self else { return true } - return self.room.mxSession.notificationCenter.rule(byId: rule.ruleId) == nil + return self.notificationCenter?.rule(byId: rule.ruleId) == nil } handleFailureCallback(completion) - room.mxSession.notificationCenter.removeRule(rule) + notificationCenter?.removeRule(rule) } private func enablePushRule(rule: MXPushRule, completion: @escaping Completion) { @@ -210,7 +214,7 @@ final class MXRoomNotificationSettingsService: RoomNotificationSettingsServiceTy } handleFailureCallback(completion) - room.mxSession.notificationCenter.enableRule(rule, isEnabled: true) + notificationCenter?.enableRule(rule, isEnabled: true) } private func handleUpdateCallback(_ completion: @escaping Completion, releaseCheck: @escaping () -> Bool) { @@ -283,14 +287,14 @@ private extension MXRoom { } var overridePushRule: MXPushRule? { - guard let overrideRules = mxSession.notificationCenter.rules.global.override else { + guard let overrideRules = mxSession?.notificationCenter?.rules?.global?.override else { return nil } return getRoomRule(from: overrideRules) } var roomPushRule: MXPushRule? { - guard let roomRules = mxSession.notificationCenter.rules.global.room else { + guard let roomRules = mxSession?.notificationCenter?.rules?.global?.room else { return nil } return getRoomRule(from: roomRules) From f8a2b45604ae19b6e926540738275968483dd51c Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Wed, 8 Feb 2023 15:28:19 +0000 Subject: [PATCH 3/6] More crashes --- Riot/Categories/MXBugReportRestClient+Riot.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Riot/Categories/MXBugReportRestClient+Riot.swift b/Riot/Categories/MXBugReportRestClient+Riot.swift index 93eff76aaa..2c46498699 100644 --- a/Riot/Categories/MXBugReportRestClient+Riot.swift +++ b/Riot/Categories/MXBugReportRestClient+Riot.swift @@ -46,10 +46,10 @@ extension MXBugReportRestClient { // User info (TODO: handle multi-account and find a way to expose them in rageshake API) var userInfo = [String: String]() let mainAccount = MXKAccountManager.shared().accounts.first - if let userId = mainAccount?.mxSession.myUser.userId { + if let userId = mainAccount?.mxSession?.myUser?.userId { userInfo["user_id"] = userId } - if let deviceId = mainAccount?.mxSession.matrixRestClient.credentials.deviceId { + if let deviceId = mainAccount?.mxSession?.myDeviceId { userInfo["device_id"] = deviceId } From 3fc07f33513eb4691b94e7b6bc0ff112a50974a6 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Wed, 8 Feb 2023 16:07:48 +0000 Subject: [PATCH 4/6] Crashes in verification view models --- ...erificationSelfVerifyWaitCoordinator.swift | 5 +- ...yVerificationSelfVerifyWaitViewModel.swift | 49 ++++++++++++++----- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinator.swift b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinator.swift index 88c2537db9..68dcab40e7 100644 --- a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinator.swift +++ b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinator.swift @@ -25,7 +25,6 @@ final class KeyVerificationSelfVerifyWaitCoordinator: KeyVerificationSelfVerifyW // MARK: Private - private let session: MXSession private var keyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWaitViewModelType private let keyVerificationSelfVerifyWaitViewController: KeyVerificationSelfVerifyWaitViewController private let cancellable: Bool @@ -40,9 +39,7 @@ final class KeyVerificationSelfVerifyWaitCoordinator: KeyVerificationSelfVerifyW // MARK: - Setup init(session: MXSession, isNewSignIn: Bool, cancellable: Bool) { - self.session = session - - let keyVerificationSelfVerifyWaitViewModel = KeyVerificationSelfVerifyWaitViewModel(session: self.session, isNewSignIn: isNewSignIn) + let keyVerificationSelfVerifyWaitViewModel = KeyVerificationSelfVerifyWaitViewModel(session: session, isNewSignIn: isNewSignIn) let keyVerificationSelfVerifyWaitViewController = KeyVerificationSelfVerifyWaitViewController.instantiate(with: keyVerificationSelfVerifyWaitViewModel, cancellable: cancellable) self.keyVerificationSelfVerifyWaitViewModel = keyVerificationSelfVerifyWaitViewModel self.keyVerificationSelfVerifyWaitViewController = keyVerificationSelfVerifyWaitViewController diff --git a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModel.swift b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModel.swift index b064d4f84b..5d4830bede 100644 --- a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModel.swift +++ b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModel.swift @@ -26,11 +26,19 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai private let session: MXSession private let keyVerificationService: KeyVerificationService - private let verificationManager: MXKeyVerificationManager + private let verificationManager: MXKeyVerificationManager? private let isNewSignIn: Bool - private var secretsRecoveryAvailability: SecretsRecoveryAvailability + private var secretsRecoveryAvailability: SecretsRecoveryAvailability? private var keyVerificationRequest: MXKeyVerificationRequest? + private var myUserId: String { + guard let userId = session.myUserId else { + MXLog.error("[KeyVerificationSelfVerifyWaitViewModel] userId is missing") + return "" + } + return userId + } + // MARK: Public weak var viewDelegate: KeyVerificationSelfVerifyWaitViewModelViewDelegate? @@ -40,10 +48,10 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai init(session: MXSession, isNewSignIn: Bool) { self.session = session - self.verificationManager = session.crypto.keyVerificationManager + self.verificationManager = session.crypto?.keyVerificationManager self.keyVerificationService = KeyVerificationService() self.isNewSignIn = isNewSignIn - self.secretsRecoveryAvailability = session.crypto.recoveryService.vc_availability + self.secretsRecoveryAvailability = session.crypto?.recoveryService.vc_availability } deinit { @@ -59,9 +67,16 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai case .cancel: self.cancel() case .recoverSecrets: - switch self.secretsRecoveryAvailability { + guard let availability = secretsRecoveryAvailability else { + MXLog.error("[KeyVerificationSelfVerifyWaitViewModel] process: secretsRecoveryAvailability not set") + self.cancel() + return + } + + switch availability { case .notAvailable: - fatalError("Should not happen: When recovery is not available button is hidden") + MXLog.error("Should not happen: When recovery is not available button is hidden") + self.cancel() case .available(let secretsRecoveryMode): self.coordinatorDelegate?.keyVerificationSelfVerifyWaitViewModel(self, wantsToRecoverSecretsWith: secretsRecoveryMode) } @@ -71,12 +86,16 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai // MARK: - Private private func loadData() { + guard let verificationManager = verificationManager else { + MXLog.failure("Verification manager is not set") + return + } if !self.isNewSignIn { MXLog.debug("[KeyVerificationSelfVerifyWaitViewModel] loadData: Send a verification request to all devices") let keyVerificationService = KeyVerificationService() - self.verificationManager.requestVerificationByToDevice(withUserId: self.session.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in + verificationManager.requestVerificationByToDevice(withUserId: self.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in guard let self = self else { return } @@ -103,7 +122,7 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai MXLog.debug("[KeyVerificationSelfVerifyWaitViewModel] loadData: Send a verification request to all devices instead of waiting") let keyVerificationService = KeyVerificationService() - self.verificationManager.requestVerificationByToDevice(withUserId: self.session.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in + verificationManager.requestVerificationByToDevice(withUserId: self.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in guard let self = self else { return } @@ -132,12 +151,18 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai } private func continueLoadData() { + guard let verificationManager = verificationManager, let recoveryService = session.crypto?.recoveryService else { + MXLog.error("[KeyVerificationSelfVerifyWaitViewModel] continueLoadData: Missing dependencies") + return + } + // update availability again - self.secretsRecoveryAvailability = session.crypto.recoveryService.vc_availability + let availability = recoveryService.vc_availability + self.secretsRecoveryAvailability = availability - let viewData = KeyVerificationSelfVerifyWaitViewData(isNewSignIn: self.isNewSignIn, secretsRecoveryAvailability: self.secretsRecoveryAvailability) + let viewData = KeyVerificationSelfVerifyWaitViewData(isNewSignIn: self.isNewSignIn, secretsRecoveryAvailability: availability) - self.registerKeyVerificationManagerNewRequestNotification(for: self.verificationManager) + self.registerKeyVerificationManagerNewRequestNotification(for: verificationManager) self.update(viewState: .loaded(viewData)) self.registerTransactionDidStateChangeNotification() self.registerKeyVerificationRequestChangeNotification() @@ -251,7 +276,7 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai @objc private func transactionDidStateChange(notification: Notification) { guard let sasTransaction = notification.object as? MXSASTransaction, - sasTransaction.isIncoming, sasTransaction.otherUserId == self.session.myUserId else { + sasTransaction.isIncoming, sasTransaction.otherUserId == self.myUserId else { return } self.sasTransactionDidStateChange(sasTransaction) From 9d12b8697873e4238b22563de48b376169efb68f Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 10 Feb 2023 11:16:35 +0000 Subject: [PATCH 5/6] version++ --- CHANGES.md | 7 +++++++ Config/AppVersion.xcconfig | 4 ++-- changelog.d/7530.bugfix | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) delete mode 100644 changelog.d/7530.bugfix diff --git a/CHANGES.md b/CHANGES.md index af14f69c51..35fea8834a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +## Changes in 1.10.2 (2023-02-10) + +🐛 Bugfixes + +- Fixes #7350 - Fix green dot only to appear for marked action ([#7530](https://github.com/vector-im/element-ios/issues/7530)) + + ## Changes in 1.10.1 (2023-02-07) ✨ Features diff --git a/Config/AppVersion.xcconfig b/Config/AppVersion.xcconfig index f1efc9679a..20e1da599c 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -15,5 +15,5 @@ // // Version -MARKETING_VERSION = 1.10.1 -CURRENT_PROJECT_VERSION = 1.10.1 +MARKETING_VERSION = 1.10.2 +CURRENT_PROJECT_VERSION = 1.10.2 diff --git a/changelog.d/7530.bugfix b/changelog.d/7530.bugfix deleted file mode 100644 index 7309798a9c..0000000000 --- a/changelog.d/7530.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes #7350 - Fix green dot only to appear for marked action \ No newline at end of file From a2ee0c3dfb0ad94b69a64e23f10ad39fc9e342e4 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 10 Feb 2023 12:05:58 +0000 Subject: [PATCH 6/6] Attempt fixing Alpha builds on releases. --- .github/workflows/release-alpha.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index e4f4671dee..4f6a1b3e3e 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -4,9 +4,7 @@ on: # Triggers the workflow on any pull request pull_request: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + types: [ labeled, synchronize, opened, reopened ] env: # Make the git branch for a PR available to our Fastfile @@ -14,11 +12,9 @@ env: jobs: build: - # Don't run for forks as secrets are unavailable. - if: | - github.event.pull_request.head.repo.full_name == github.repository && - (github.event_name == 'push' || - (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Trigger-PR-Build'))) + # Only run for PRs that contain the trigger label. The action will fail for forks due to + # missing secrets, but there's no need to handle this as it won't run automatically. + if: contains(github.event.pull_request.labels.*.name, 'Trigger-PR-Build') name: Release runs-on: macos-12