Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.8.0 (unreleased)

* Update Kotlin SDK to 1.7.0.
* Update PowerSync SQLite core to 0.4.10
* 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
* Enable the `newClientImplementation` by default. This should improve performance and memory usage.


## 1.7.0

* Update Kotlin SDK to 1.7.0.
Expand Down
14 changes: 9 additions & 5 deletions Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
5 changes: 5 additions & 0 deletions Tests/PowerSyncTests/ConnectTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down