localStorage wiped on 0.12.3 upgrade and subsequent app launches
See original GitHub issueI’ve just started testing my app with 0.14.5 instead of 0.12.3. On first launch, all my app’s settings in localStorage were wiped. (Similar to #4527, except not using an app://
protocol. Just referencing localStorage
). I thought maybe this was a migration bug, but it also seems that localStorage is wiped for each app launch. Are there any oddities with localStorage that could explain this, or any known workarounds?
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (7 by maintainers)
Top Results From Across the Web
Local storage data getting deleted… | Apple Developer Forums
Hi Team, We are using following different concepts for storing the users data in the device in our hybrid mobile application and even...
Read more >Does localStorage in Javascript get wiped off after clearing ...
Yes localstorage does get cleared when browser data is removed. Save a URL as a string on the mobile device somewhere which always...
Read more >Changelog - Cypress Documentation
Whether enabled or disabled, this changes how Cypress cleans up the browser context before each test and you may experience test errors with...
Read more >LocalStorage, sessionStorage - The Modern JavaScript Tutorial
Web storage objects localStorage and sessionStorage allow to save key/value pairs in the browser. ... We'll see that later in this chapter.
Read more >Window.localStorage - Web APIs | MDN
( localStorage data for a document loaded in a "private browsing" or "incognito" session is cleared when the last "private" tab is closed.) ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a theory that this is NOT an issue with 0.14.5 migrating data from old versions but instead a result of running the old 0.12.3 nw.js version of the app AFTER running the new 0.14.5 version. Since the user data files have been moved to the new location after running the 0.14.5 version, the 0.12.3 version will start and create new empty localStorage/IndexedDB files. If the 0.14.5 version is ran after that the newly created empty localStorage/IndexedDB files from the 0.12.3 version are copied OVER the existing 0.14.5 versions. This results in empty localStorage/IndexedDB.
After testing this theory a few times I believe it to be the cause. This would explain why the behavior seemed inconsistent. If this is the case, a user can wipe their data by running the old version of the app which is scary.
To all people who have issues: please upload a sample with user data dir of 0.12 so I can reproduce it.