Fix a potential bug where the token couldn't be refreshed when the cached server /versions had expired. (#4687)

* Update SDK mocks for UniFFI 0.30.0

* Update the SDK.

* Update the SDK again

Includes a temporary workaround that patches the SDK's generated Swift files so that our tests don't crash:
https://github.com/element-hq/matrix-rust-components-swift/commit/3f0075fb8acaf202755512dfbafc28024e5125b2
This commit is contained in:
Doug
2025-11-03 19:09:31 +00:00
committed by GitHub
parent 371c31ba0d
commit 419c18cabb
16 changed files with 1062 additions and 535 deletions
File diff suppressed because it is too large Load Diff
@@ -97,7 +97,7 @@ struct MessageForwardingScreen_Previews: PreviewProvider, TestablePreview {
let summaryProvider = RoomSummaryProviderMock(.init(state: .loaded(.mockRooms)))
let viewModel = MessageForwardingScreenViewModel(forwardingItem: .init(id: .randomEvent,
roomID: "",
content: .init(noPointer: .init())),
content: .init(noHandle: .init())),
userSession: UserSessionMock(.init()),
roomSummaryProvider: summaryProvider,
userIndicatorController: UserIndicatorControllerMock())
@@ -35,9 +35,8 @@ struct AuthenticationClientFactory: AuthenticationClientFactoryProtocol {
enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode,
enableKeyShareOnInvite: appSettings.enableKeyShareOnInvite,
threadsEnabled: appSettings.threadsEnabled)
.sessionPaths(dataPath: sessionDirectories.dataPath,
cachePath: sessionDirectories.cachePath)
.sessionPassphrase(passphrase: passphrase)
.sqliteStore(config: .init(dataPath: sessionDirectories.dataPath, cachePath: sessionDirectories.cachePath)
.passphrase(passphrase: passphrase))
.serverNameOrHomeserverUrl(serverNameOrUrl: homeserverAddress)
.build()
}
@@ -141,7 +141,7 @@ class MockTimelineController: TimelineControllerProtocol {
func unpin(eventID: String) async { }
func messageEventContent(for itemID: TimelineItemIdentifier) -> RoomMessageEventContentWithoutRelation? {
.init(noPointer: .init())
.init(noHandle: .init())
}
func debugInfo(for itemID: TimelineItemIdentifier) -> TimelineItemDebugInfo {
@@ -212,7 +212,7 @@ struct SendHandleProxy: Hashable {
static var mock: SendHandleProxy {
.init(itemID: .event(uniqueID: .init(UUID().uuidString),
eventOrTransactionID: .eventID(UUID().uuidString)),
underlyingHandle: .init(noPointer: .init()))
underlyingHandle: .init(noHandle: .init()))
}
}
@@ -123,11 +123,11 @@ class UserSessionStore: UserSessionStoreProtocol {
enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode,
enableKeyShareOnInvite: appSettings.enableKeyShareOnInvite,
threadsEnabled: appSettings.threadsEnabled)
.sessionPaths(dataPath: credentials.restorationToken.sessionDirectories.dataPath,
cachePath: credentials.restorationToken.sessionDirectories.cachePath)
.sqliteStore(config: .init(dataPath: credentials.restorationToken.sessionDirectories.dataPath,
cachePath: credentials.restorationToken.sessionDirectories.cachePath)
.passphrase(passphrase: credentials.restorationToken.passphrase))
.username(username: credentials.userID)
.homeserverUrl(url: homeserverURL)
.sessionPassphrase(passphrase: credentials.restorationToken.passphrase)
do {
let client = try await builder.build()