Skip to content

invalidateCredentials of PowerSyncBackendConnector should not be called on any streamSync error #102

@benoitletondor

Description

@benoitletondor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions