Skip to content

Commit 5e20c40

Browse files
feat: default newClientImplementation
1 parent 6ed7103 commit 5e20c40

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.8.0 (unreleased)
4+
5+
* Update Kotlin SDK to 1.7.0.
6+
* Update PowerSync SQLite core to 0.4.10
7+
* 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
8+
* Enable the `newClientImplementation` by default. This should improve performance and memory usage.
9+
10+
311
## 1.7.0
412

513
* Update Kotlin SDK to 1.7.0.

Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public struct ConnectOptions: Sendable {
9090
self.crudThrottle = crudThrottle
9191
self.retryDelay = retryDelay
9292
self.params = params
93-
newClientImplementation = false
93+
newClientImplementation = true
9494
self.clientConfiguration = clientConfiguration
9595
}
9696

@@ -100,7 +100,7 @@ public struct ConnectOptions: Sendable {
100100
crudThrottle: TimeInterval = 1,
101101
retryDelay: TimeInterval = 5,
102102
params: JsonParam = [:],
103-
newClientImplementation: Bool = false,
103+
newClientImplementation: Bool = true,
104104
clientConfiguration: SyncClientConfiguration? = nil
105105
) {
106106
self.crudThrottle = crudThrottle
@@ -311,11 +311,11 @@ public extension PowerSyncDatabaseProtocol {
311311
func disconnectAndClear() async throws {
312312
try await disconnectAndClear(clearLocal: true, soft: false)
313313
}
314-
314+
315315
func disconnectAndClear(clearLocal: Bool) async throws {
316316
try await disconnectAndClear(clearLocal: clearLocal, soft: false)
317317
}
318-
318+
319319
func disconnectAndClear(soft: Bool) async throws {
320320
try await disconnectAndClear(clearLocal: true, soft: soft)
321321
}

Tests/PowerSyncTests/ConnectTests.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testable import PowerSync
1+
@testable @_spi(PowerSyncExperimental) import PowerSync
22
import XCTest
33

44
final class ConnectTests: XCTestCase {
@@ -116,6 +116,11 @@ final class ConnectTests: XCTestCase {
116116
try await database.connect(
117117
connector: TestConnector(url: fakeUrl),
118118
options: ConnectOptions(
119+
/// Note that currently, HTTP logs are only supported with the old client implementation
120+
/// which uses HTTP streams.
121+
/// The new client implementation uses a WebSocket connection instead.
122+
/// Which we don't get logs for currently.
123+
newClientImplementation: false,
119124
clientConfiguration: SyncClientConfiguration(
120125
requestLogger: SyncRequestLoggerConfiguration(
121126
requestLevel: .all

0 commit comments

Comments
 (0)