Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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