Start a new topic

Pending Sync Count on logout

Hi, 

I'm using Kinvey on Nativescript. I'd like to ask if we use Sync type of DataStore and we have pending sync because no internet. Is the data in pending sync wiped out if we log out?

1 Comment

Hi Henry,


Yes. All the data in pending sync will be wiped out if you log out. Logout clears the active user and all related data, preventing other app users from accessing it. The deleted data includes:  

  • Cached tokens
  • User attributes
  • DataStore caches
  • Offline data pending to be written to the backend


Keep the following considerations in mind when using logout:  

  • If your app needs to persist pending offline data, remember to push or sync the user's changes before logout.

  • To persist any user attributes that were modified after the last update, save the user before logout.

  • Recreate any DataStore instances used by your app after the user logs in again. DataStore instances maintain references to cache files which get destroyed on logout. Attempts to reuse the same instance of a  DataStore may result in unexpected behavior.

  • If the user was subscribed to the live service, they will be unsubscribed on logout. You will need to resubscribe the user to the live service, on a fresh login.


Hope I have answered your question. Please let me know if you have any additional questions.




Thanks,

Pranav

Kinvey


Login or Signup to post a comment