MMKV icon indicating copy to clipboard operation
MMKV copied to clipboard

iOS singleProcessModel 数据丢失问题

Open xujianbo12345 opened this issue 1 year ago • 7 comments

Note:

iOS singleProcessModel 数据丢失问题

The language of MMKV

Objective-C

The version of MMKV

v1.3.2

image 我们从多进程切换到单进程后也出现用户反馈数据丢失的问题,我看文档里面提到微信也每天很多CRC校验失败的,是通过 return MMKVOnErrorRecover 方案解决的吗

xujianbo12345 avatar Jan 25 '24 09:01 xujianbo12345

First thing first, I don't think switching process mode will cause file corruption. In iOS, when an MMKV instance is created with multi-process mode, it's stored inside the AppGroup folder. When it's in single-process mode, it's stored inside the document folder. These are two totally different locations.

Have you done data migration when you said switching from multi-process mode to single-process mode? Or did you just simply change the mode?

lingol avatar Jan 25 '24 09:01 lingol

First thing first, I don't think switching process mode will cause file corruption. In iOS, when an MMKV instance is created with multi-process mode, it's stored inside the AppGroup folder. When it's in single-process mode, it's stored inside the document folder. These are two totally different locations.

Have you done data migration when you said switching from multi-process mode to single-process mode? Or did you just simply change the mode?

There is no problem with data migration and normal test. Currently, this problem occurs for newly installed users. Is there any situation that may cause data writing or reading failure all the time

xujianbo12345 avatar Jan 25 '24 10:01 xujianbo12345

You should provide logs of MMKV to further investigate.

lingol avatar Jan 25 '24 11:01 lingol

You should provide logs of MMKV to further investigate.

For the time being, there is no recurrence of the data loss scenario here, so there is no log, but there are several user feedback and guidance page pop-up problems, from the code analysis is the MMKV cache problem. Can the data recovery and backup mentioned in the documentation help

xujianbo12345 avatar Jan 26 '24 02:01 xujianbo12345

You have your priorities wrong. If we can't figure out what caused the problem, there's no way to know whether something helps or not.

lingol avatar Jan 26 '24 04:01 lingol

You have your priorities wrong. If we can't figure out what caused the problem, there's no way to know whether something helps or not.

The current feedback from users is that when the APP is not restarted, we have a reminder pop-up window on the home page that only plays once, and when we enter the secondary page and come back again, the pop-up window logic will be followed again. At this time, if there is a successful write, it should not pop up, but the actual situation is that it will play every time you return to the home page, does it mean that MMKV memory writing has failed? More than just local file exception?

xujianbo12345 avatar Jan 26 '24 04:01 xujianbo12345

Are you in a loop? Why did you repeat yourself by saying almost the same thing (well with some much longer sentences), yet still failing to provide logs to figure out what caused the problem?

lingol avatar Jan 26 '24 07:01 lingol

Closed due to inactive.

lingol avatar Mar 18 '24 03:03 lingol