Start a new topic

Backbone caching - not getting latest data

Running my app on my mobile device via Phonegap with Airplane mode (no internet)...



When I modify the User and save, I see that the changes are going into the Sync (Kinvey.Sync.count() ) and the data is updated on the User.



When I restart the app (still offline) and Kinvey initializes, it restores User to the values before it went offline. The Sync count is still correct and if I go online, all of my changes are applied correctly.



Am I using the Automated Control incorrectly?



Kinvey.init({appKey: Config.Kinvey.appKey,

appSecret: Config.Kinvey.appSecret,

sync: {

enable: true,

online : navigator.onLine

}

})
1 Comment

No, this is expected. On initialization, the Kinvey server retrieves the latest user data from Kinvey. In your use case, is the locally changed data overridden?



If so, you can add the `refresh: false` flag to the `Kinvey.init` call. After, I recommend syncing your offline changes with Kinvey, and then the local and remote data should be the same.
Login or Signup to post a comment