powersync-ja/powersync.dart

Not able to sync if offline first

Opened this issue · 1 comments

I have a table that is synced for every user with holidays.

If the app initializes with a connection, that table is synced and all holidays are available on the SQLite.

If the app is offline when started, that table is NEVER synced anymore, no matter if the device become online (and PowerSync logs says FINE), nor if I stop and restart the app online. It just ignores the table forever.

Steps to reproduce:

  1. Create a table in Postgres with some data (mine was about 130 records with date and name)
  2. Make sure your docker container is stopped, so the connection would fail
  3. Open the app and make sure to call PS connect (it will fail after some time, in the logs)
  4. Close the app (or don't, it doesn't matter)
  5. Start the docker container
  6. Run the app again (or wait for PS to connect automatically), you'll see the FINE log (which means the sync was done)
  7. No data will be available in the SQLite database for that table

Could you elaborate on the FINE log that you see? FINE is typically the level, and there should be more detailed log messages.

One guess: Quite often, issues like these are caused by data upload issues, which then blocks the download. Make sure that there are no errors thrown in your uploadData function.