Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Migrate storage from AsyncStorage to MMKV #1265

Merged
merged 6 commits into from
Jan 17, 2025
Merged

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Dec 19, 2024

Since we migrated the project to RN73 we can now use MMKV instead of AsyncStorage

This migration is done in order to improve performances. MMKV being faster by multiple order of magnitude than AsyncStorage

This PR replaces #1097

### ✨ Features

*

### 🐛 Bug Fixes

*

### 🔧 Tech

* Migrate storage management from AsyncStorage to MMKV

await migrateFromAsyncStorage()
setHasMigrated(true)
} catch (e) {
// TODO: fall back to AsyncStorage? Wipe storage clean and use MMKV? Crash app?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO ? But don't know what to do...

@zatteo
Copy link
Contributor

zatteo commented Dec 20, 2024

About the second commit message

Since we migrated the project to RN73 we can now use MMKV instead of
AsyncStorage

There are no links with RN73 no?

@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from 46a63ec to 9f81a02 Compare December 20, 2024 09:15
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from 9f81a02 to e76e118 Compare December 20, 2024 14:30
@Ldoppea Ldoppea force-pushed the feat/mmkv branch 2 times, most recently from acd273d to 9215bc8 Compare December 20, 2024 16:43
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from e76e118 to 9477980 Compare December 20, 2024 17:32
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from 9477980 to 550084c Compare December 20, 2024 19:37
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from 550084c to 4c6ccc2 Compare December 20, 2024 19:54
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from 4c6ccc2 to fabbd4e Compare December 20, 2024 20:08
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from fabbd4e to 8821f44 Compare December 20, 2024 20:20
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch from 8821f44 to 07cefb5 Compare January 9, 2025 10:50
@Ldoppea Ldoppea marked this pull request as ready for review January 16, 2025 10:46
@Ldoppea Ldoppea requested a review from acezard as a code owner January 16, 2025 10:46
@Ldoppea Ldoppea force-pushed the feat/add_performance_measurements branch 2 times, most recently from 6b4861a to 1cc6687 Compare January 16, 2025 12:31
Base automatically changed from feat/add_performance_measurements to feat/meta_offline January 17, 2025 10:05
Ldoppea and others added 2 commits January 17, 2025 11:19
Since our previous upgrades we can now use MMKV instead of AsyncStorage

This migration is done in order to improve performances. MMKV being
faster by multiple order of magnitude than AsyncStorage

Code taken from #1097

Co-authored-by: Théo Poizat <[email protected]>
Since we migrated to MMKV, existing users' data should be migrated from
the old AsyncStorage to MMKV

Code taken from #1097

Co-authored-by: Théo Poizat <[email protected]>
@Ldoppea Ldoppea merged commit d4c67f9 into feat/meta_offline Jan 17, 2025
1 check passed
@Ldoppea Ldoppea deleted the feat/mmkv branch January 17, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants