Data modification directly in Atlas fires Client Reset if App is not running (No breaking Schema) - Flexible Sync

If I modify data directly in Atlas and the android App is not running, then on the next run of the App; Client Reset is fired. Is it an expected behavior?

No Schema Change happening in this case.

Steps to reproduce:

  1. Create a simple collection in Atlas
  2. Add a single document in the collection with three fields: say String - name, String - email, Bool - isTrue
  3. Create an android App
  4. Flexible sync it with Query:
    subscriptions.add(Subscription.create("userSubscription", realm.where(my_user.class) .equalTo("email","abcd@gmail.com")));
  5. Now quit the App
  6. Modify ‘isTrue’ to true ---- via atlas
  7. Run the App again
  8. Result: ending session with error: bad last integrated server version in upload progress (500180358788 > 17) (ProtocolErrorCode=209)

Is it a normal behavior or is it a BUG?

Client reset logic is wha you need to have implemented.

Then terminate sync, wait 10 minutes, re-enable sync. It’s a type of bad changeset.

To clarify on this as some over at DevCalibration reached out to me.

This issue is caused because it’s a mislabeling of a bad changeset, you have a document on the local client which has been updated and that’s trying to push at the same time the server is sending another version of the document elsewhere, basically making the client and server both have different versions of the document.

The only known and seen solution to this error, is a full termination and resync, as deleting the document in the server has proven to not work. Same with just deleting the document on the local client because it’s something going on with the writer processes and the server not completing the upload/write/syncing.

By terminating sync, AFTER client reset logic is in place to keep unsynced documents this issue is corrected once sync is re-enabled.

It won’t make a difference if you delete the doc locally, or on server at all, because it will not abort the “upload” even if the writer doesn’t even see it.

It’s only when the term and resync happens that the upload is aborted, and upon resync the new version of the document makes it to be synced, again to reiterate, a term and resync is the only thing you can really do in this situation for the reasons outlined.