Skip to content

Conversation

stevensJourney
Copy link
Contributor

Overview

Currently the Legacy sync implementation can cause delays for uploading CRUD operations made while offline.

This can happen if:

  • CRUD operations are made while the client is offline
  • The PowerSync client connect method is then called.
  • The client connects to the service, but we don't currently immediately upload the pending operations.
  • The client will download updates from the service, but wont apply them until we have uploaded all pending items (this has been delayed/ not triggered)
  • The client is effectively blocked until the next keepalive event is received from the service (this kicks off a upload)

This PR triggers an upload after receiving the first PowerSync service command line. This same method is currently used by the Rust implementation.

The handles write made while offline test has been updated. We no longer send a keepalive immediately from the mocked service. This test would previously fail without the keepalive.

@stevensJourney stevensJourney marked this pull request as ready for review September 4, 2025 22:49
Copy link
Contributor

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@stevensJourney stevensJourney merged commit 38c7f8c into main Sep 5, 2025
4 of 5 checks passed
@stevensJourney stevensJourney deleted the upload-keepalive-fix branch September 5, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants