Skip to content

Commit

Permalink
Default to native sliding sync discovery.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave authored and stefanceriu committed Aug 30, 2024
1 parent 015e32d commit 904045f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ElementX/Sources/Application/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ final class AppSettings {
var pinningEnabled

enum SlidingSyncDiscovery: Codable { case proxy, native, forceNative }
@UserPreference(key: UserDefaultsKeys.slidingSyncDiscovery, defaultValue: .proxy, storageType: .userDefaults(store))
@UserPreference(key: UserDefaultsKeys.slidingSyncDiscovery, defaultValue: .native, storageType: .userDefaults(store))
var slidingSyncDiscovery: SlidingSyncDiscovery

#endif
Expand Down
4 changes: 2 additions & 2 deletions ElementX/Sources/Services/UserSession/RestorationToken.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ extension RestorationToken: Codable {
extension MatrixRustSDK.Session: Codable {
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let slidingSyncVersion: SlidingSyncVersion = try container.decodeIfPresent(String.self, forKey: .slidingSyncProxy).map { .proxy(url: $0) } ?? .native
let slidingSyncProxy = try container.decodeIfPresent(String.self, forKey: .slidingSyncProxy)
self = try .init(accessToken: container.decode(String.self, forKey: .accessToken),
refreshToken: container.decodeIfPresent(String.self, forKey: .refreshToken),
userId: container.decode(String.self, forKey: .userId),
deviceId: container.decode(String.self, forKey: .deviceId),
homeserverUrl: container.decode(String.self, forKey: .homeserverUrl),
oidcData: container.decodeIfPresent(String.self, forKey: .oidcData),
slidingSyncVersion: slidingSyncVersion)
slidingSyncVersion: slidingSyncProxy.map { .proxy(url: $0) } ?? .native)
}

public func encode(to encoder: Encoder) throws {
Expand Down

0 comments on commit 904045f

Please sign in to comment.