Update SDK to 1.0.102-alpha (#1408)

* Update SDK to 1.0.102-alpha

* Log error

* Notification Improvements API part 1 (#1410)

* changes

* WIP

* progress

* updated test

* removed unused

* code improvement

* Process diffs as batches provided by the SDK.

---------

Co-authored-by: Mauro <34335419+Velin92@users.noreply.github.com>
Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
Alfonso Grillo
2023-07-27 11:48:56 +02:00
committed by GitHub
parent 188d41e59d
commit 1529b5b8ca
12 changed files with 117 additions and 160 deletions
+8 -3
View File
@@ -34,7 +34,7 @@ final class NSEUserSession {
try baseClient.restoreSession(session: credentials.restorationToken.session)
notificationClient = baseClient
notificationClient = try baseClient
.notificationClient()
.retryDecryption(withCrossProcessLock: true)
.finish()
@@ -43,10 +43,15 @@ final class NSEUserSession {
func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? {
await Task.dispatch(on: .global()) {
do {
guard let notification = try self.notificationClient.getNotification(roomId: roomID, eventId: eventID) else {
let notification = try self.notificationClient.getNotificationWithSlidingSync(roomId: roomID, eventId: eventID)
guard let notification else {
return nil
}
return NotificationItemProxy(notificationItem: notification, receiverID: self.userID, roomID: roomID)
return NotificationItemProxy(notificationItem: notification,
eventID: eventID,
receiverID: self.userID,
roomID: roomID)
} catch {
MXLog.error("NSE: Could not get notification's content creating an empty notification instead, error: \(error)")
return EmptyNotificationItemProxy(eventID: eventID, roomID: roomID, receiverID: self.userID)