Even IndexedDb? Having a PWA based on webassembly(Blazor) that I test on an updated iPhone 6 I have to say that I didn't ever run in such issues, the experience is good even though the device is old.
They definitely clear localstorage. But they also are honest about doing this under disk pressure — can’t find the link right now though. My old company had a Cordova app and we stored the client token in localstorage and we found some 16G phones losing their tokens and it turned out to be this. We changed to store tokens in the keyring. From a real web app you can’t but I guess if you would use a cookie this might just work.
Also sometimes localStorage gets cleared because it can easily become corrupted from concurrent writes. I had a userscript that made a few fetch calls whenever I visited a certain domain and saved the results in localStorage. Every week or so, all the data in localStorage would just get wiped. Switching to IndexedDB (via localForage) solved the problem.
I was about to say "concurrent writes shouldn't be a problem because localStorage is synchronous and JS is single-threaded," but then I started thinking about multiple tabs, WebWorkers, and multi-process browsers and figured I should double-check the spec.
> Warning! The localStorage getter provides access to shared state. This specification does not define the interaction with other agent clusters in a multiprocess user agent, and authors are encouraged to assume that there is no locking mechanism. A site could, for instance, try to read the value of a key, increment its value, then write it back out, using the new value as a unique identifier for the session; if the site does this twice in two different browser windows at the same time, it might end up using the same "unique" identifier for both sessions, with potentially disastrous effects.
Yes, a full local reset. Its an issue that plagued us for almost a year sporadically across several thousand customers. After instrumenting our app with very detailed remote logging, we were fortunate enough to catch it on one of our in-house local test iPhones. The logging showed an app with rich local state, the app close, then several minutes later the app open with no local state. Everything was wiped. This lined up with the feedback we had been receiving. Specifically for us, the push notification subscription tokens were being erased/revoked from the browser, meaning the customer couldn't receive notifications anymore. But the logging showed all local state was reset, including IndexedDb. If you dig through the Apple developer forums and StackOverflow, you will see many others complaining about this. You will also see links to resources claiming that Apple ITP does not do this for PWAs, specifically:
My personal belief is that Apple is purposefully nuking PWAs from orbit in a non-deterministic and "buggy" way because they are a threat to the app store business model, and I suspect if they frustrate enough developers, people will stay away from PWAs.
Nah. I used to be a iOS developer. The official native frameworks are buggy as hell. Everything is broken all the time. Occam's razor is on this behaviour being just another bug that receives little attention because everything else is also buggy. I can't even blame them, the iOS api surface is huge, and every year there's new frameworks and every couple of years new devices. Android has the advantage of being open source, which allows external contributions to fix bugs, which oftentimes fixes the small-percentage bugs because one developer ran into it and decided to fix it. On iOS this is impossible, and there's no corporate incentive to fix small-percentage bugs.
You’re wrong, this has nothing to do with bugs. We’re speaking of Safari not implenting features for years and pushing back many of them because of “security”. All bs.