09-21-2012 07:01 PM
I have a Webworks application that uses local storage to persist data. There’s a behaviour that I have noticed happening to two different devices (9900 and 9780 OS 18.104.22.1686). The users have noticed that the application data keeps getting deleted (favourites they have earmarked in the app are gone, local variable that indicates initial sync was completed is gone etc). The application stores the data in local storage and I am suspecting that somehow the application is losing its relationship to local storage and perhaps storing the data elsewhere. That is until it is removed from memory again and they experience the same behaviour.
The local storage file is there but was last modified over a month ago. It should have had today’s timestamp. Also when I deleted the local storage, the application was still able to run and was getting the data from somewhere else.
Has anyone seen a similar behaviour with the local storage? Do you know what would cause it or what could be done to prevent it?
09-25-2012 08:26 AM
I've used localStorage in a similar way and never noticed that happening. The exception is when I would do an OS update. In my case I was saving some oauth access tokens in localStorage.
My data was saved even upon battery-pulls so this seems a bit odd.
Is anything changing on the phone(s)? Any OS updates, or anything else like that?
09-25-2012 12:34 PM
That is interesting -thanks.
We upgraded the OS and policy before we installed the application so that woudn't be the cause. We have looked to see if there were any other changes and it doesn't look like it.
10-01-2012 10:57 AM
I'm assuming the app id in your config.xml hasn't changed either? There seem to be certain OS 6 builds that localStorage didn't perform as expected on, but the 9900 running OS7 I don't have an answer as to why this would be happening to some users.
Is this an app that's already being distributed? Could it be that some users are emailing in saying their favourites are gone, but it's happened because they're doing os updates, etc?
Lastly, how are you setting the localStorage variables exactly? Can you paste a code snippet just in case something is off there?
10-02-2012 11:41 AM
This is an app that is already being distributed in our organization through BES. The app id has not changed. It is unlikely that the users perform their own OS upgrade as it is my understanding that this is done from the BES and before we deployed this application we upgraded everyone to at least OS 22.214.171.1246.
Does this mean that we can no longer upgrade devices without possibly breaking the localstorage connection? What about policy changes?
Here is sample code I am using to access localstorage. We are using GUIDs as keys.