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

iOS CRC验证失败率比 Android平台高,请问有什么方案可以降低失败率吗 #1396

Closed
free46000 opened this issue Sep 5, 2024 · 2 comments

Comments

@free46000
Copy link

free46000 commented Sep 5, 2024

Note:

iOS CRC验证失败率比 Android平台高,请问有什么方案可以降低失败率吗

The version of MMKV

android和iOS版本都是 1.3.9

The platform of MMKV

iOS 和 Android

What's the issue?

1.android平台CRC验证失败率万分之1左右,iOS平台CRC验证失败率千分之1左右,ios比android高一个数量级(crc验证失败是通过sdk中MMKVHandler#onMMKVCRCCheckFail回调收集)
2.如果区分mmapid看,iOS失败率高的mmapId有个特征是会在收到UIApplicationWillTerminateNotification,进程即将被杀的时候有保存数据的操作
3.针对crc验证失败的用户我们收集了mmkv error log,主要是以下两个类型的日志:

  • "level":"E","message":"check crc [WKWEBVIEW_CLEANER_STORE_ID] fail, crc32:269008617, m_crcDigest:2048346931","func":"MMKV.cpp-417-checkFileCRCValid"
  • "level":"E","message":"check [WKWEBVIEW_CLEANER_STORE_ID] error: lastActualSize 4, lastActualCRC 3897398710","func":"MMKV_IO.cpp-254-operator()"

请问有什么方案可以降低crc验证失败的概率吗,比如频繁调用mmkv#sync方法

@free46000 free46000 changed the title iOS CRC iOS CRC验证失败率比 Android平台高,请问有什么方案可以降低失败率吗 Sep 5, 2024
@lingol
Copy link
Collaborator

lingol commented Sep 5, 2024

You can try sync() when you get UIApplicationWillTerminateNotification.
No guarantee though.

@free46000
Copy link
Author

好的,我们准备尝试在置后台和收到UIApplicationWillTerminateNotification消息的时候调用sync方法,看看线上效果如何

另外可以给分享下微信的Android和iOS每天crc验证失败的用户量的统计吗?大概量级也可以,我想确认下我们的失败比例是否正常?

@lingol lingol closed this as completed Sep 6, 2024
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

2 participants