I recently had to update a native module in my electron project. Just to be sure to have a clean installation I first removed all node_modules and reinstalled them via npm install. Then I rebuilt my native module via electron-rebuild
After starting my app, I figured that the localStorage had been reset and all my data had been lost.
Now I am confused. Do I need to worry about localStorage being reset when sending app updates to my clients?
The localStorage does not get lost. By default Electron will store the files (indexDB etc.) under the user's home directory, depending on your operating system:
Windows:
C:\Users\<you>\AppData\Local\<Your App Name>
macOS:
~/Library/Application Support/<Your App Name>
Linux:
~/.config/<Your App Name>
Unless you change your application name or otherwise purge your database these files will still be there after each update.