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

Increase AsyncStorage read and write limits #1003

Merged
merged 2 commits into from
Nov 13, 2023
Merged

Conversation

zatteo
Copy link
Contributor

@zatteo zatteo commented Nov 7, 2023

Fix backup issues resulting in "Backup config not initialized" errors

Read limit per entry : 2MB to 50MB
Write limit per whole app: 6MB to 100MB

Default Android cursor size is 2MB so we can not store entries larger
than 2MB by default. But backup feature store quickly more than 2MB.

There are two main possibilities :
- AsyncStorage recommand to separate data in multiple entries and use
multiGet and multiSet
- increase sCursorWindowSize in MainApplication.java

I try here the second way now which looks like the "easy quick fix".

50MB seems a reasonable value here. 1000 pictures in mediasToBackup ~
330KiB

See
react-native-async-storage/async-storage#617 (comment)
and
https://react-native-async-storage.github.io/async-storage/docs/limits
After increasing read limit, let's increase write limit using the AsyncStorage recommended way.
@zatteo zatteo marked this pull request as ready for review November 10, 2023 10:26
@zatteo zatteo merged commit 1c69d10 into master Nov 13, 2023
1 check passed
@zatteo zatteo deleted the fix/backup-local-storage branch November 13, 2023 08:53
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