Fix synchronisation issues when loading multiple libraries #421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! I was experiencing with some state problems when dealing with multiple libraries. In my setup, I have a children library and a normal library, and sometimes the app just restored in the "wrong" library, although showing the resume playback pill from another library, and sometimes also forgetting my listening process.
I am not Swift developer at all, do not know the codebase at all, but have 20 years of software development experience, and decided to try to fix these issues with Claude Code. The result of this experiment is in this PR, and I would ask you to please check this out, and make the call yourself as the Real Swift Developer™️, if these changes actually make sense 😅 On a superficial level these do look quite legit, and on my brief testing with an emulator and with a device, the synchronisation issues seemed to decrease. The original situation felt like a race condition, and Claude Code was multiple times referring to these changes fixing a race condition in the initial syncronization.
The part that I am not very much not sure, are the changes to
ShelfPlayerKit/Persistence/ProgressSubsystem.swift. I do not completely understand what is happening there, but the change did seem to fix the issue of progress being lost from time to time.Hopefully these vibecodings of mine are at least remotely helpful for you :)
Issues fixed, according to CC