mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Automatically retry decryptions in the active room when the app becomes active again just in case the NSE received keys we're not aware of (#3628)
This commit is contained in:
@@ -139,8 +139,6 @@ class MockRoomTimelineController: RoomTimelineControllerProtocol {
|
||||
nil
|
||||
}
|
||||
|
||||
func retryDecryption(for sessionID: String) async { }
|
||||
|
||||
func eventTimestamp(for itemID: TimelineItemIdentifier) -> Date? {
|
||||
timelineItemsTimestamp[itemID] ?? .now
|
||||
}
|
||||
|
||||
@@ -356,10 +356,6 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
return nil
|
||||
}
|
||||
|
||||
func retryDecryption(for sessionID: String) async {
|
||||
await activeTimeline.retryDecryption(for: sessionID)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
/// The cancellable used to update the timeline items.
|
||||
|
||||
-2
@@ -82,7 +82,5 @@ protocol RoomTimelineControllerProtocol {
|
||||
|
||||
func sendHandle(for itemID: TimelineItemIdentifier) -> SendHandleProxy?
|
||||
|
||||
func retryDecryption(for sessionID: String) async
|
||||
|
||||
func eventTimestamp(for itemID: TimelineItemIdentifier) -> Date?
|
||||
}
|
||||
|
||||
@@ -155,12 +155,14 @@ final class TimelineProxy: TimelineProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func retryDecryption(for sessionID: String) async {
|
||||
MXLog.info("Retrying decryption for sessionID: \(sessionID)")
|
||||
func retryDecryption(sessionIDs: [String]?) async {
|
||||
let sessionIDs = sessionIDs ?? []
|
||||
|
||||
MXLog.info("Retrying decryption for sessionIDs: \(sessionIDs)")
|
||||
|
||||
await Task.dispatch(on: .global()) { [weak self] in
|
||||
self?.timeline.retryDecryption(sessionIds: [sessionID])
|
||||
MXLog.info("Finished retrying decryption for sessionID: \(sessionID)")
|
||||
self?.timeline.retryDecryption(sessionIds: sessionIDs)
|
||||
MXLog.info("Finished retrying decryption for sessionID: \(sessionIDs)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ protocol TimelineProxyProtocol {
|
||||
|
||||
func messageEventContent(for timelineItemID: TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation?
|
||||
|
||||
func retryDecryption(for sessionID: String) async
|
||||
func retryDecryption(sessionIDs: [String]?) async
|
||||
|
||||
func paginateBackwards(requestSize: UInt16) async -> Result<Void, TimelineProxyError>
|
||||
func paginateForwards(requestSize: UInt16) async -> Result<Void, TimelineProxyError>
|
||||
@@ -113,3 +113,9 @@ protocol TimelineProxyProtocol {
|
||||
html: String?,
|
||||
intentionalMentions: Mentions) -> RoomMessageEventContentWithoutRelation
|
||||
}
|
||||
|
||||
extension TimelineProxyProtocol {
|
||||
func retryDecryption() async {
|
||||
await retryDecryption(sessionIDs: nil)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user