swift-composable-architecture icon indicating copy to clipboard operation
swift-composable-architecture copied to clipboard

[Building Sync-ups Tutorial] fixes in "Persisting sync-ups" chapter

Open FredericRuaudel opened this issue 3 weeks ago • 0 comments

Hi!

Following my last PR, I'm currently reviewing the "Building Sync-ups" tutorial and so far, there is a lot of changes so I've splitted up into one PR per chapter to ease the review of them, continuing with the "Persisting sync-ups" chapter here…

Changes Made:

  • "Persisting data to disk" Tutorial Section Enhancements:

    • Implemented thread-safe mutations of the shared syncUps using withLock.
    • Updated the tutorial code to compile correctly with the new file storage approach.
  • "Testing persistence" Tutorial Section Improvements:

    • Moved the initialization of syncUps outside of the TestStore to prevent shared state issues during testing.
    • Incorporated withLock for thread-safe mutations of shared state.
    • Enhanced the tutorial explanation to provide clearer guidance on the fixes implemented.

Doing so, I needed to add new steps in the tutorial description and so new code files too. I tried my best to match your tone and vocabulary in the description of the new steps but feel free to enhance the copyrighting if you need to.

FredericRuaudel avatar Feb 01 '25 14:02 FredericRuaudel