mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add retry decryption encrypted timeline item debug menu option (#384)
* Fixed a couple of warnings (+2 squashed commits) Squashed commits: [21fbc3b0] Add changelog [abb092c6] Add retry decryption encrypted timeline item debug menu option * Cleanup room list state computations * Bump the RustSDK to v1.0.25-alpha * Fix brew CI errors: remove imagemagick and brew lock file entirely * Fix release script version bumping * Bump ruby dependencies
This commit is contained in:
@@ -81,4 +81,6 @@ struct MockRoomProxy: RoomProxyProtocol {
|
||||
}
|
||||
return .failure(.failedRetrievingMembers)
|
||||
}
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async { }
|
||||
}
|
||||
|
||||
@@ -147,8 +147,6 @@ class RoomProxy: RoomProxyProtocol {
|
||||
return .failure(.noMoreMessagesToBackPaginate)
|
||||
}
|
||||
|
||||
let id = id // Copy the ID due to @Sendable requirement.
|
||||
|
||||
do {
|
||||
let outcome: PaginationOutcome = try await Task.dispatch(on: .global()) {
|
||||
try self.room.paginateBackwards(limit: UInt16(count))
|
||||
@@ -242,19 +240,27 @@ class RoomProxy: RoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func update(avatarURL: String?, forUserId userId: String) {
|
||||
func retryDecryption(forSessionId sessionId: String) async {
|
||||
await Task.dispatch(on: .global()) { [weak self] in
|
||||
self?.room.retryDecryption(sessionIds: [sessionId])
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func update(avatarURL: String?, forUserId userId: String) {
|
||||
memberAvatars[userId] = avatarURL
|
||||
}
|
||||
|
||||
func update(displayName: String?, forUserId userId: String) {
|
||||
private func update(displayName: String?, forUserId userId: String) {
|
||||
memberDisplayNames[userId] = displayName
|
||||
}
|
||||
|
||||
func update(displayName: String) {
|
||||
private func update(displayName: String) {
|
||||
self.displayName = displayName
|
||||
}
|
||||
|
||||
func update(backPaginationOutcome: PaginationOutcome) {
|
||||
private func update(backPaginationOutcome: PaginationOutcome) {
|
||||
self.backPaginationOutcome = backPaginationOutcome
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ protocol RoomProxyProtocol {
|
||||
func redact(_ eventID: String) async -> Result<Void, RoomProxyError>
|
||||
|
||||
func members() async -> Result<[RoomMemberProxy], RoomProxyError>
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async
|
||||
}
|
||||
|
||||
extension RoomProxyProtocol {
|
||||
|
||||
@@ -62,10 +62,9 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
}
|
||||
|
||||
func updateRoomsWithIdentifiers(_ identifiers: [String]) {
|
||||
#warning("This is a valid check but Rust doesn't set it correctly for selective ranged syncs")
|
||||
// guard statePublisher.value == .live else {
|
||||
// return
|
||||
// }
|
||||
guard statePublisher.value == .live else {
|
||||
return
|
||||
}
|
||||
|
||||
var changes = [CollectionDifference<RoomSummary>.Change]()
|
||||
for identifier in identifiers {
|
||||
|
||||
@@ -42,4 +42,6 @@ struct MockRoomTimelineProvider: RoomTimelineProviderProtocol {
|
||||
func redact(_ eventID: String) async -> Result<Void, RoomTimelineProviderError> {
|
||||
.failure(.failedRedactingItem)
|
||||
}
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async { }
|
||||
}
|
||||
|
||||
@@ -139,6 +139,10 @@ class RoomTimelineProvider: RoomTimelineProviderProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async {
|
||||
await roomProxy.retryDecryption(forSessionId: sessionId)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func updateItemsWithDiffs(_ diffs: [TimelineDiff]) {
|
||||
|
||||
@@ -40,6 +40,8 @@ protocol RoomTimelineProviderProtocol {
|
||||
func editMessage(_ newMessage: String, originalItemId: String) async -> Result<Void, RoomTimelineProviderError>
|
||||
|
||||
func redact(_ eventID: String) async -> Result<Void, RoomTimelineProviderError>
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async
|
||||
}
|
||||
|
||||
extension RoomTimelineProviderProtocol {
|
||||
|
||||
@@ -87,4 +87,6 @@ class MockRoomTimelineController: RoomTimelineControllerProtocol {
|
||||
func debugDescriptionFor(_ itemId: String) -> String {
|
||||
"Mock debug description"
|
||||
}
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async { }
|
||||
}
|
||||
|
||||
@@ -204,6 +204,10 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
|
||||
return description
|
||||
}
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async {
|
||||
await timelineProvider.retryDecryption(forSessionId: sessionId)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
|
||||
+2
@@ -61,4 +61,6 @@ protocol RoomTimelineControllerProtocol {
|
||||
func redact(_ eventID: String) async
|
||||
|
||||
func debugDescriptionFor(_ itemId: String) -> String
|
||||
|
||||
func retryDecryption(forSessionId sessionId: String) async
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user