Reputation: 1957
I've found various web pages discussing how Apple erases the storage of IndexedDb data in Safari for sites that haven't been visited in at least 7 days (unless you add the site to your desktop). They claim it's a privacy enhancement.
I'm working on an app in Neutralino, which uses an OS webview instead of bundling in a browser like Electron does. I want to use a JS database library like Pouch or Loki, which have IndexedDb adapters for persisting the data. But that creates the worry that using IndexedDb will create data loss for users who don't use it regularly.
If I can be sure the IndexedDb data would persist on Mac, I'd use it. It will save me the time of writing a device storage adapter using the Neutralino filesystem APIs. This is a semi-blocking issue. I intend to build in a "bring your own database" interface that can be used to create an adapter for any database, but that was intended as a V2 feature, not MVP.
Being able to use one of these databases without having to write that abstraction layer or a persistence adapter for one would help me get to MVP and start recruiting beta testers faster.
I just can't find any solid confirmation that Apple won't clobber the IndexedDb data in the MacOS webview Neutralino uses if the user doesn't boot the app at least once every 7 days.
Does anyone know if the MacOS webview (or a Neutralino-based Mac desktop app) is safe from Apple's 7-day rule?
Upvotes: 0
Views: 106
Reputation: 1957
From my experiment, the data did disappear. That said, it wasn't too hard to write a persistence adapter for my chosen database (LokiJS) using the Neutralino APIs to save the database file in ~/Library/Application Support/[Name of App].
Upvotes: 0