Skip to content

Commit b67a485

Browse files
committed
Warn for unknown instructions instead of throwing
1 parent 07e8616 commit b67a485

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

core/src/commonMain/kotlin/com/powersync/sync/SyncOptions.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,13 @@ public data class RSocketKeepAlive(
7373
val interval: Duration,
7474
val maxLifetime: Duration,
7575
) {
76-
internal fun toRSocket(): KeepAlive {
77-
return KeepAlive(interval, maxLifetime)
78-
}
76+
internal fun toRSocket(): KeepAlive = KeepAlive(interval, maxLifetime)
7977

8078
internal companion object {
81-
val default = RSocketKeepAlive(
82-
interval = 20.0.seconds,
83-
maxLifetime = 30.0.seconds,
84-
)
79+
val default =
80+
RSocketKeepAlive(
81+
interval = 20.0.seconds,
82+
maxLifetime = 30.0.seconds,
83+
)
8584
}
8685
}

core/src/commonMain/kotlin/com/powersync/sync/SyncStream.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import co.touchlab.kermit.Logger
44
import co.touchlab.kermit.Severity
55
import co.touchlab.stately.concurrency.AtomicReference
66
import com.powersync.ExperimentalPowerSyncAPI
7-
import com.powersync.PowerSyncException
87
import com.powersync.bucket.BucketChecksum
98
import com.powersync.bucket.BucketRequest
109
import com.powersync.bucket.BucketStorage
@@ -401,7 +400,7 @@ internal class SyncStream(
401400
status.update { copy(downloadError = null) }
402401
}
403402
is Instruction.UnknownInstruction -> {
404-
throw PowerSyncException("Unknown instruction received from core extension: ${instruction.raw}", null)
403+
logger.w { "Unknown instruction received from core extension: ${instruction.raw}" }
405404
}
406405
}
407406
}

0 commit comments

Comments
 (0)