ionic-team / ionic-team/ionic-storage

Splitting `IndexedDB` table when migrating from `CRA` to `vite`

Aperta
#323 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
456
Fork
97
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello, we encountered the problem when we tried to migrate our `ionic v6.0` (`CRA`) project to `ionic v7.0` (vite). Withing this migration we removed `CRA` specific files and added `vite` specific files, while not touching the code for working with `@ionic/storage`, the same drivers are used there (`IndexedDB` + `localStorage`), the name is the same.

After the migration, we started testing the update on an Android smartphone and found that changing the version meant that the app no ​​longer saw data from storage. However, if you reinstall the previous version, the data is restored.

This behavior is specific only to mobile devices, on the web under desktop or mobile the error is not reproduced.

I checked `IndexedDB` via the Android debugger in Chrome and saw that ``IndexedDB` and the data in the Storage section in DevTools are indeed erased, while the amount of memory in the Storage section of the device settings shows that the memory required for the application has not decreased.

It looks to me like after switching from CRA to vite we now have 2 IndexedDBs in the phone's memory, but for some reason CRA can only connect to its own, and vite can only connect to its own in the app itself.

Can you suggest any solutions to this problem?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue names no repository files, entry points, or tests. Start by reproducing the CRA-to-Vite migration on an Android device and inspect the IndexedDB stores before and after the upgrade; done means identifying whether separate stores are created and documenting or implementing a verified migration path.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, typescript, vite
Ambito
databases, mobile-dev
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.