Add a migration to expire sync sessions so that m.space.* state is up to date. (#4482)

This commit is contained in:
Doug
2025-09-09 15:35:32 +01:00
committed by GitHub
parent 2f2e6f6226
commit 19189bec06
6 changed files with 116 additions and 29 deletions
@@ -2392,6 +2392,41 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
stopSyncCompletionCallsCount += 1
stopSyncCompletionClosure?(completion)
}
//MARK: - expireSyncSessions
var expireSyncSessionsUnderlyingCallsCount = 0
var expireSyncSessionsCallsCount: Int {
get {
if Thread.isMainThread {
return expireSyncSessionsUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = expireSyncSessionsUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
expireSyncSessionsUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
expireSyncSessionsUnderlyingCallsCount = newValue
}
}
}
}
var expireSyncSessionsCalled: Bool {
return expireSyncSessionsCallsCount > 0
}
var expireSyncSessionsClosure: (() async -> Void)?
func expireSyncSessions() async {
expireSyncSessionsCallsCount += 1
await expireSyncSessionsClosure?()
}
//MARK: - accountURL
var accountURLActionUnderlyingCallsCount = 0