Skip to content

Splitting IndexedDB table when migrating from CRA to vite #323

@imblowfish

Description

@imblowfish

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions