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

[Bug] MMKV lefts some calls of setString not saved in db #291

Open
szyymoon opened this issue Oct 17, 2022 · 5 comments
Open

[Bug] MMKV lefts some calls of setString not saved in db #291

szyymoon opened this issue Oct 17, 2022 · 5 comments

Comments

@szyymoon
Copy link

Describe the bug
Hello, I got some problem with mmkv. I decided to use it as a log db, that creates new instance of db on every day. Works awesome but I have one problem, probably only with sync calls. My app in DEBUG log level produce tons of logs, and unfortunatelly not all calls of my "logStorage.setString(date, ${date} | ${level} | ${msg} \n);" are saved to DB while in logcat you can find all of them.

To Reproduce
App that save tons of quick calls to db.

Expected behavior
All occurs of setString can be found in db

Platform Information:

  • OS: Android > 8 (my is 10)
  • React Native Version 69.5
  • Library Version 0.8.0
@szyymoon szyymoon changed the title [Bug] MMKV lefts saome calls not saved in db [Bug] MMKV lefts some calls of setString not saved in db Oct 17, 2022
@channeladam
Copy link

This doesn't sound good... (I am trying to decide which MMKV package to use)

@ammarahm-ed
Copy link
Owner

If you can provide a reproducible example, I can take a look.

@szyymoon
Copy link
Author

szyymoon commented Dec 19, 2022

Just make some use case that will make several calls to mmkv in one seconds. for instance some kind of subscriber to orm that will be log every sql call to mmkv. In my casemmkv saves only last call from specific seconds.

for instance for that:

12-15 14:33:42.123 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): logLevel: 10
12-15 14:33:42.224 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: INFO: getCheckWorkerStatus(): {"id":1,"workInterval":null,"workElapsedRealTime":null,"lastWorkSuccess":true,"lastWorkDateTime":"2022-12-15 14:33:39"}
12-15 14:33:42.344 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): CurrencyChangingProccess: false
12-15 14:33:42.442 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): backendCommandWorkerProcessing: STOPED
12-15 14:33:42.447 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): backendCommandWorkerID: 1
12-15 14:33:42.486 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): licenseWorkerProcessing: STOPED
12-15 14:33:42.487 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): LicenseWorkerID: 2
12-15 14:33:42.526 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): CheckWorkerID: 3
12-15 14:33:42.527 6352 6393 D WKF_LOG_FROM_JAVASCRIPT: DEBUG: ASYNC_STORAGE setData(): checkWorkerProcessing: STOPED

only last one is saved to mmkv. This logs are from android logcat. I have made mirror logs to logcat to check what logs are missing.

@ammarahm-ed
Copy link
Owner

Have you tried simply setting 10-100 values in mmkv at once & then checking they exist or not? I believe that they should exist. Not the logs, but some random data.

@Seyatseyhan
Copy link

Seyatseyhan commented Dec 19, 2022 via email

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

No branches or pull requests

4 participants