See https://github.com/powersync-ja/powersync-kotlin/blob/main/core/src/commonMain/kotlin/com/powersync/sync/SyncStream.kt#L103
The following code calls invalidateCredentials
every time there's an error, no matter the error. If you have no network, the credentials are invalidated every X seconds, resulting in a lot of useless queries (that will fail since there's no network anyway).
Also, the code just above is probably wrong too, you want to rethrow the CancellationException
if you catch it, not just avoiding logging in case of it. See https://medium.com/mobilepeople/how-to-break-a-coroutine-cancellation-12e968c31642