I noticed that some mutations sequence of persisted shared state (file storage) breaks saving to disk. What is interesting that it has to be sequence of fast and little slower mutations. After saving on edit become broken then it stay broken until some other saving trigger will save the file (for example willResignActiveNotification), then it restores save on edit.
Problem occurs on either simulator and device and debug and release mode.
During test sometimes saving was broken immediately after second edit. However most of the time, sequence of edits was necessary to cause the problem
Below is a sample project which illustrates the problem and also screen recording. On screen recording I also catch some weird behaviour when editing file on disk, which caused some weird data values to be "restored"
Description
I noticed that some mutations sequence of persisted shared state (file storage) breaks saving to disk. What is interesting that it has to be sequence of fast and little slower mutations. After saving on edit become broken then it stay broken until some other saving trigger will save the file (for example
willResignActiveNotification
), then it restores save on edit.Problem occurs on either simulator and device and debug and release mode.
During test sometimes saving was broken immediately after second edit. However most of the time, sequence of edits was necessary to cause the problem
Below is a sample project which illustrates the problem and also screen recording. On screen recording I also catch some weird behaviour when editing file on disk, which caused some weird data values to be "restored"
sample project: SharedStateNotSaved.zip screen recording: https://nextcloud.pomba.org.pl/s/5QiK77q7AKSF49C
Checklist
main
branch of this package.Expected behavior
Shared state with file storage persistence should be reliably saved according to 1s eager throttle strategy.
Actual behavior
After some sequence of mutation saving is broken.
Steps to reproduce
The Composable Architecture version information
1.10.3
Destination operating system
17.14.1
Xcode version information
Version 15.3 (15E204a)
Swift Compiler version information