might've found a really awful bug in Kinvey.Sync API
started a topic
about 4 years ago
spent the past few hours trying to reproduce a bizarre issues I'm seeing with Sync API..basically I've got an app that likes to "live offline". By that I mean once my user does a login, I never make them login again. The app will run offline 99% of the time, periodically syncing data with Kinvey if connection strength/quality allows. Basically my app is designed to be used in gyms which have some pretty notoriously bad cellphone signals. At any rate, that's how it works.
conflict resolution policy is set to where the client will always win (only one user ever reads/writes their data at this point). So I've got one value that's just a single object literal. Basically a user preferences object. The collection is called userConfig. I can save this value fine, and it will sync. However, kill the app and restart, and the following workflow triggers:
1) check for existing user with call to Kinvey.getActiveUser()
2) if user is found, force app offline with call to Kinvey.Sync.offline()
3) call refreshData method which basically goes and gets the most recent data for each of my define collections. This will pull data from the local cache since I'm offline, no roundtrip to server
So here's the kicker: the call to Kinvey.DataStore.find against userConfig, operating against local cache, is returning ALL the available userConfig records, not just the single entry tied to the current active user. It only does this when working against the local cache. If I force the app to roundtrip to the server on this refresh step, it will return the correct # of records i.e. only ones associated with the active user. The userConfig collection has permissions set to Private.
So it looks like what is happening is when I do the Sync to save/update the user's record in this userConfig collection, it then updates the local cache with all of the records from the collection. No clue why but that seems to be the case
It's only doing this with this one collection though...none of my other defined collections seem to have this issue??? Not really sure what to do next to figure this one out :(
So I finally figured out wtf is going on..it's not Kinvey at all thankfully, it's this pos Telerik AppBuilder tool. It's doing something wonky with local storage apparently that's fouling up the Kinvey cache stuff.
Telerik has managed to create just about the buggiest, most maddening IDE on the market right now from what I can tell. can't wait to migrate off of it...everything works fine on device so, we're good
about 4 years ago
Sorry to hear about the troubles and I'm glad you got it figured out!