psf / pycon-us-mobile

Apache License 2.0
29 stars 10 forks source link

migrate to sqlite storage #43

Open ewdurbin opened 1 year ago

ewdurbin commented 1 year ago

I'm learning that there's some caveats with the storage module as it stands - we're on older versions of all libraries due to the template not being up-to-date with latest, and some things have changed. Specifically, how storage options are leveraged - the version we're using states:

As a major example, iOS will currently clear out Local Storage (and IndexedDB it's been shown) when the device runs low on memory. To avoid that, a file-based storage approach with SQLite will retain all your data.

The examples for the version we're using show cordova-based actions, not capacitor ones. Newer versions of the @ionic/storage library have capacitor examples, and have extracted angular-specifics to a separate library @ionic/storage-angular.

The capacitor preferences docs share an approach that's a little more opinionated and might be a smart conversion for our user-data.ts approach specifically for preferences like themes, filters, etc.

I don't know if it's worth pursuing this as a larger conversion right now, or whether the off-chance of losing some user state is worth an overhaul - I'm thinking not for now.

Originally posted by @miketheman in https://github.com/psf/pycon-us-mobile/issues/37#issuecomment-1503014561

miketheman commented 5 months ago

The updated ionic-storage requires Angular 14.x or higher, we're on 13, so we would have to upgrade Angular first as well.