Skip to content

fix: down syncs not being reflected in client app #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

DominicGBauer
Copy link
Contributor

Description

  1. Fix the issue where client IDs were not matching leading to down syncs not being shown on the client app.
  2. Fix updateObjectsFromBuckets always returning true.

Work Done

  • There was an erroneously included ' at the end of clientId when hitting the write-checkpoint endpoint which I have now removed.
  • Moved to writeTransaction in updateLocalTarget function as there is a write occurring in the transaction.
  • Moved to use new delete_pending_buckets operation.
  • updateObjectsFromBuckets now returns the response from
val res = tx.get("select last_insert_rowid()") { cursor ->
    cursor.getLong(0)!!
}

as opposed to the execute

res = tx.execute(
     "INSERT INTO powersync_operations(op, data) VALUES(?, ?)",
      listOf("sync_local", "")
)

which always returned 1 row updated and therefore always resolved to true

Testing

Screen.Recording.2024-10-08.at.5.21.22.PM.mov

@DominicGBauer DominicGBauer self-assigned this Oct 8, 2024
@DominicGBauer DominicGBauer merged commit 55cf059 into main Oct 8, 2024
3 checks passed
@DominicGBauer DominicGBauer deleted the fix/bug-with-client-id branch October 8, 2024 17:28
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.

3 participants