-
Notifications
You must be signed in to change notification settings - Fork 29
[Fix] CRUD Upload on Reconnect #203
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
Conversation
Co-authored-by: Mughees Khan <mugikhan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Some unit tests are broken. Will investigate. |
For my own reference, since I was confused with how this could happen:
The fix here targets (3), by basically triggering the "there are more changes" stream when the sync connection is established again. |
@stevensJourney thanks for being working on this. We're following the PR because it got a huge impact in our last update here. Thanks. |
Tests pass more consistently now. The main issues were from the I've shuffled around the CRUD loop exit checks in order to exit the loop faster when disconnecting or closing. |
- powersync@1.8.9 - powersync_attachments_helper@0.6.13 - powersync_flutter_libs@0.4.2
c92e7f5
Overview
This fixes an issue where CRUD uploads are not triggered when the SDK reconnects to the PowerSync service after being offline.
Previously uploads were only triggered when an initial call to
.connect
has been made or when changes to theps_crud
table have occurred. If an application called.connect
successfully, then went offline and made CRUD operations - the SDK would not trigger a CRUD upload once it had re-established a connection.This now triggers a CRUD upload whenever the SDK establishes a connection or a change has been made to
ps_crud
.Testing
This was tested locally and unit tests have been added using a mock PowerSync service.