Skip to content

Commit e1f1188

Browse files
stragler fixes
1 parent c93c5e1 commit e1f1188

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

Package.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 6.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -54,14 +54,14 @@ let package = Package(
5454
platforms: [
5555
.iOS(.v13),
5656
.macOS(.v10_15),
57-
.watchOS(.v9),
57+
.watchOS(.v9)
5858
],
5959
products: [
6060
// Products define the executables and libraries a package produces, making them visible to other packages.
6161
.library(
6262
name: packageName,
6363
targets: ["PowerSync"]
64-
),
64+
)
6565
],
6666
dependencies: conditionalDependencies,
6767
targets: [
@@ -71,12 +71,12 @@ let package = Package(
7171
name: packageName,
7272
dependencies: [
7373
kotlinTargetDependency,
74-
.product(name: "PowerSyncSQLiteCore", package: corePackageName),
74+
.product(name: "PowerSyncSQLiteCore", package: corePackageName)
7575
]
7676
),
7777
.testTarget(
7878
name: "PowerSyncTests",
79-
dependencies: ["PowerSync"],
80-
),
79+
dependencies: ["PowerSync"]
80+
)
8181
] + conditionalTargets
8282
)

Sources/PowerSync/Kotlin/KotlinPowerSyncDatabaseImpl.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import Foundation
22
import PowerSyncKotlin
33

4-
final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol, @unchecked Sendable {
4+
final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol,
5+
// `PowerSyncKotlin.PowerSyncDatabase` cannot be marked as Sendable
6+
@unchecked Sendable
7+
{
58
let logger: any LoggerProtocol
6-
79
private let kotlinDatabase: PowerSyncKotlin.PowerSyncDatabase
810
private let encoder = JSONEncoder()
911
let currentStatus: SyncStatus
@@ -270,7 +272,7 @@ final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol, @unchecked S
270272
}
271273

272274
func writeLock<R: Sendable>(
273-
callback: @escaping (any ConnectionContext) throws -> R
275+
callback: @Sendable @escaping (any ConnectionContext) throws -> R
274276
) async throws -> R {
275277
return try await wrapPowerSyncException {
276278
try safeCast(
@@ -283,7 +285,7 @@ final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol, @unchecked S
283285
}
284286

285287
func writeTransaction<R: Sendable>(
286-
callback: @escaping (any Transaction) throws -> R
288+
callback: @Sendable @escaping (any Transaction) throws -> R
287289
) async throws -> R {
288290
return try await wrapPowerSyncException {
289291
try safeCast(
@@ -311,7 +313,7 @@ final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol, @unchecked S
311313
}
312314

313315
func readTransaction<R: Sendable>(
314-
callback: @escaping (any Transaction) throws -> R
316+
callback: @Sendable @escaping (any Transaction) throws -> R
315317
) async throws -> R {
316318
return try await wrapPowerSyncException {
317319
try safeCast(
@@ -417,7 +419,7 @@ extension Error {
417419
}
418420

419421
func wrapLockContext(
420-
callback: @escaping (any ConnectionContext) throws -> Any
422+
callback: @Sendable @escaping (any ConnectionContext) throws -> Any
421423
) throws -> PowerSyncKotlin.ThrowableLockCallback {
422424
PowerSyncKotlin.wrapContextHandler { kotlinContext in
423425
do {
@@ -436,7 +438,7 @@ func wrapLockContext(
436438
}
437439

438440
func wrapTransactionContext(
439-
callback: @escaping (any Transaction) throws -> Any
441+
callback: @Sendable @escaping (any Transaction) throws -> Any
440442
) throws -> PowerSyncKotlin.ThrowableTransactionCallback {
441443
PowerSyncKotlin.wrapTransactionContextHandler { kotlinContext in
442444
do {

Sources/PowerSync/attachments/SyncingService.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ public actor SyncingService: SyncingServiceProtocol {
148148
)
149149
.sink { _ in continuation.yield(()) }
150150

151-
continuation.onTermination = { _ in
152-
cancellable.cancel()
153-
}
154151
self.cancellables.insert(cancellable)
155152
}
156153
}

0 commit comments

Comments
 (0)