Automatically sign out when toggling the SSS feature flag. (#3071)

This commit is contained in:
Doug
2024-07-23 11:55:51 +01:00
committed by GitHub
parent 9879552b46
commit bf22250b45
14 changed files with 43 additions and 14 deletions
@@ -21,15 +21,20 @@ extension ClientBuilder {
/// A helper method that applies the common builder modifiers needed for the app.
static func baseBuilder(setupEncryption: Bool = true,
httpProxy: String? = nil,
slidingSync: ClientBuilderSlidingSync,
slidingSyncProxy: URL? = nil,
sessionDelegate: ClientSessionDelegate,
simplifiedSlidingSyncEnabled: Bool,
appHooks: AppHooks) -> ClientBuilder {
var builder = ClientBuilder()
.slidingSyncProxy(slidingSyncProxy: slidingSyncProxy?.absoluteString)
.enableCrossProcessRefreshLock(processId: InfoPlistReader.main.bundleIdentifier, sessionDelegate: sessionDelegate)
.userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent())
.simplifiedSlidingSync(enable: simplifiedSlidingSyncEnabled)
builder = switch slidingSync {
case .restored: builder
case .discovered: builder.requiresSlidingSync()
case .simplified: builder.simplifiedSlidingSync(enable: true)
}
if setupEncryption {
builder = builder
@@ -45,3 +50,12 @@ extension ClientBuilder {
return appHooks.clientBuilderHook.configure(builder)
}
}
enum ClientBuilderSlidingSync {
/// The proxy will be supplied when restoring the Session.
case restored
/// A proxy must be discovered whilst building the session.
case discovered
/// Use Simplified Sliding Sync (discovery isn't a thing yet).
case simplified
}