11import Foundation
22import 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
419421func 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
438440func 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 {
0 commit comments