There’s an issue where updating @Shared from a thread other than the main thread triggers a warning during debugging and sometimes causes crashes in the release configuration.
Store state was accessed on a non-main thread. …
The "Store" class is not thread-safe, and so all interactions with an instance of "Store" (including all of its scopes and derived view stores) must be done on the main thread
Checklist
[X] I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
[X] If possible, I've reproduced the issue using the main branch of this package.
Hi @larryonoff, this will be fixed in #3178 when we require that withLock be @MainActor. I am going to convert this to a discussion for now, so please feel free to continue the discussion over there!
Description
There’s an issue where updating
@Shared
from a thread other than the main thread triggers a warning during debugging and sometimes causes crashes in the release configuration.Checklist
main
branch of this package.Expected behavior
Crashes or warnings do not occur
Actual behavior
Crashlytics reports occasional crashes. Xcode shows warnings during debugging.
Steps to reproduce
Refer to the sample project
The Composable Architecture version information
1.11.1
Destination operating system
iOS 17.5.1
Xcode version information
Version 15.4 (15F31d)
Swift Compiler version information