diff --git a/CHANGELOG.md b/CHANGELOG.md index 36549ea..c0342a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.8.0 (unreleased) + +* Enable the `newClientImplementation` by default. This should improve performance and memory usage. +* **Potential Breaking Change** The `newClientImplementation` now uses WebSockets to connect to the PowerSync service. These WebSockets connections do not log events to `SyncClientConfiguration->requestLogger`. +* Add the `soft` flag to `disconnectAndClear()` which keeps an internal copy of synced data in the database, allowing faster re-sync if a compatible token is used in the next connect() call +* Update PowerSync SQLite core to 0.4.10 +* Update Kotlin SDK to 1.7.0. + + ## 1.7.0 * Update Kotlin SDK to 1.7.0. diff --git a/Demo/PowerSyncExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Demo/PowerSyncExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index e6ba700..d0281aa 100644 --- a/Demo/PowerSyncExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Demo/PowerSyncExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "2d885a1b46f17f9239b7876e3889168a6de98024718f2d7af03aede290c8a86a", + "originHash" : "33297127250b66812faa920958a24bae46bf9e9d1c38ea6b84ca413efaf16afd", "pins" : [ { "identity" : "anycodable", @@ -10,6 +10,15 @@ "version" : "0.6.7" } }, + { + "identity" : "csqlite", + "kind" : "remoteSourceControl", + "location" : "https://github.com/powersync-ja/CSQLite.git", + "state" : { + "branch" : "3.51.1", + "revision" : "25f4a02fce2dcd588bad37ea6fc047c2bbe8ef5e" + } + }, { "identity" : "powersync-sqlite-core-swift", "kind" : "remoteSourceControl", diff --git a/Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift b/Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift index 0a8bd75..2b45603 100644 --- a/Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift +++ b/Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift @@ -90,17 +90,21 @@ public struct ConnectOptions: Sendable { self.crudThrottle = crudThrottle self.retryDelay = retryDelay self.params = params - newClientImplementation = false + newClientImplementation = true self.clientConfiguration = clientConfiguration } /// Initializes a ``ConnectOptions`` instance with optional values, including experimental options. - @_spi(PowerSyncExperimental) + @available( + *, + deprecated, + message: "Specifying the newClientImplementation flag is no longer needed. It is now enabled by default. The use of the old client is deprecated and will be removed in a future version." + ) public init( crudThrottle: TimeInterval = 1, retryDelay: TimeInterval = 5, params: JsonParam = [:], - newClientImplementation: Bool = false, + newClientImplementation: Bool = true, clientConfiguration: SyncClientConfiguration? = nil ) { self.crudThrottle = crudThrottle @@ -311,11 +315,11 @@ public extension PowerSyncDatabaseProtocol { func disconnectAndClear() async throws { try await disconnectAndClear(clearLocal: true, soft: false) } - + func disconnectAndClear(clearLocal: Bool) async throws { try await disconnectAndClear(clearLocal: clearLocal, soft: false) } - + func disconnectAndClear(soft: Bool) async throws { try await disconnectAndClear(clearLocal: true, soft: soft) } diff --git a/Tests/PowerSyncTests/ConnectTests.swift b/Tests/PowerSyncTests/ConnectTests.swift index 9473d21..b0167da 100644 --- a/Tests/PowerSyncTests/ConnectTests.swift +++ b/Tests/PowerSyncTests/ConnectTests.swift @@ -116,6 +116,11 @@ final class ConnectTests: XCTestCase { try await database.connect( connector: TestConnector(url: fakeUrl), options: ConnectOptions( + /// Note that currently, HTTP logs are only supported with the old client implementation + /// which uses HTTP streams. + /// The new client implementation uses a WebSocket connection instead. + /// Which we don't get logs for currently. + newClientImplementation: false, clientConfiguration: SyncClientConfiguration( requestLogger: SyncRequestLoggerConfiguration( requestLevel: .all