mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Revert "Open the room live when tapping the notification for its newest message"
This reverts commit 4c71cae0f.
Comparing against other delivered notifications doesn't reflect the timeline:
in rooms set to mentions and keywords, after swiping away newer notifications
or with messages sent from another device, newer messages can exist without a
notification, so the room opened live with the tapped event out of view.
This commit is contained in:
@@ -21,7 +21,6 @@ final class NotificationManagerTests {
|
||||
private var shouldDisplayInAppNotificationReturnValue = false
|
||||
private var handleInlineReplyDelegateCalled = false
|
||||
private var notificationTappedDelegateCalled = false
|
||||
private var notificationTappedIsNewestInRoom: Bool?
|
||||
private var registerForRemoteNotificationsDelegateCalled: (() -> Void)?
|
||||
private let appSettings: AppSettings
|
||||
|
||||
@@ -239,31 +238,6 @@ final class NotificationManagerTests {
|
||||
#expect(notificationTappedDelegateCalled)
|
||||
}
|
||||
|
||||
@Test
|
||||
func whenTappedNotificationIsTheNewestInItsRoom_delegateIsToldItIsNewest() async throws {
|
||||
notificationManager.delegate = self
|
||||
let date = Date.now
|
||||
notificationCenter.deliveredNotificationsReturnValue = try [UNNotification.with(userInfo: [NotificationConstants.UserInfoKey.roomIdentifier: "!room:matrix.org"], date: date - 60),
|
||||
UNNotification.with(userInfo: [NotificationConstants.UserInfoKey.roomIdentifier: "!other:matrix.org"], date: date + 60)]
|
||||
|
||||
let response = try UNTextInputNotificationResponse.with(userInfo: [NotificationConstants.UserInfoKey.roomIdentifier: "!room:matrix.org"], date: date)
|
||||
await notificationManager.userNotificationCenter(UNUserNotificationCenter.current(), didReceive: response)
|
||||
|
||||
#expect(notificationTappedIsNewestInRoom == true)
|
||||
}
|
||||
|
||||
@Test
|
||||
func whenTappedNotificationIsOlderThanAnotherInItsRoom_delegateIsToldItIsNotNewest() async throws {
|
||||
notificationManager.delegate = self
|
||||
let date = Date.now
|
||||
notificationCenter.deliveredNotificationsReturnValue = try [UNNotification.with(userInfo: [NotificationConstants.UserInfoKey.roomIdentifier: "!room:matrix.org"], date: date + 60)]
|
||||
|
||||
let response = try UNTextInputNotificationResponse.with(userInfo: [NotificationConstants.UserInfoKey.roomIdentifier: "!room:matrix.org"], date: date)
|
||||
await notificationManager.userNotificationCenter(UNUserNotificationCenter.current(), didReceive: response)
|
||||
|
||||
#expect(notificationTappedIsNewestInRoom == false)
|
||||
}
|
||||
|
||||
@Test
|
||||
func updatingAppBadgeCountUsesTheClientSideCount() async {
|
||||
clientProxy.totalUnreadNotifications = 7
|
||||
@@ -298,9 +272,8 @@ extension NotificationManagerTests: @MainActor NotificationManagerDelegate {
|
||||
shouldDisplayInAppNotificationReturnValue
|
||||
}
|
||||
|
||||
func notificationTapped(content: UNNotificationContent, isNewestInRoom: Bool) async {
|
||||
func notificationTapped(content: UNNotificationContent) async {
|
||||
notificationTappedDelegateCalled = true
|
||||
notificationTappedIsNewestInRoom = isNewestInRoom
|
||||
}
|
||||
|
||||
func handleInlineReply(_ service: ElementX.NotificationManagerProtocol, content: UNNotificationContent, replyText: String) async {
|
||||
|
||||
Reference in New Issue
Block a user