Start a new topic

Local cached data can be seen by others

If an iPhone is used for two users, then the local cached data can be seen, by another user after switching id (log out and log in), for like 0.5 second. Then the new information will be updated. This may make users feel unsafe.

Fixed. It is my fault. Sorry.

It may also be a common mistake. I saved the query result in a NSArray variable of the tableview. But I did not release the variable in -(void)viewWillDisappear:(BOOL)animated{}. So when the view is closed, the variable is still saved. I guess this is a default setting of iPhone. When opening the tableview again, the previous saved data will be available at the very begining. So it will appear on the screen. After the query result is returned from Kinvey, the table will be updated again.



So the conclusion is that always release the local variable in -(void)viewWillDisappear:(BOOL)animated{}.
For example, Let's say in your app there is a notification table to record all the friend requests from others (so that they can add you as a friend). When opening the view of notification, two users should query the same data collection, say there is a data collection "NotificationTable" in the backend, to get their notification messages from backend. So I cached the query result in my app (The cachepolicy is LocalFirst). Then after switching id, the results of previous user will appear on the screen for a short moment (about 0.5 second). Then new results of current user will be shown.



I am not sure if this is a problem of Kinvey or my iPhone setting.
Cached data should be cleared on logout. Can you send us an example project?
Login or Signup to post a comment