Replies: 1 comment 1 reply
-
@nmalevich We recently added this runtime warning because nested observes can have unintended consequences. In this case, a To work around the problem, you can move DispatchQueue.main.async {
observe { [weak self] in
…
}
} We're still deciding if this warning is too heavy-handed, but we don't consider it a bug at the moment. Because of this I'm going to convert this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Description
Warning "An "observe" was called from another "observe" closure, which can lead to over-observation and unintended side effects." was added in version 1.9.3 and become at unnecessary cases
I attach example project where you can see that bug
BadObserveExample.zip
Checklist
main
branch of this package.Expected behavior
Warning doesn't appear
Actual behavior
Warning appears
Steps to reproduce
Just run app and wait. Screens will navigate by themselves
The Composable Architecture version information
1.9.3
Destination operating system
iOS 17.4.1
Xcode version information
15.3
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions