Closed nmalevich closed 7 months ago
Hi @nmalevich, can you please provide a project that demonstrates the behavior you are seeing? I don't think this is an issue with the library so I am going to convert this to a discussion for now. We can re-open an issue if it turns out to be something wrong with TCA.
Description
When I have migrated to 1.9 version from 1.3 and started to use @ObservableState, @Presents, observe {}(I use UIKit for UI) and all what you recommend. All is good and thank you for your effort to improve TCA.
But now I have one problem with dismiss dependency. I didn't have this problem when I used 1.3 version. The problem is when I execute dismiss() from dismiss dependency at my child feature, not only my child feature set nil, but the parent feature too. The parent feature is added to main reducer by Scope(state:action:) and child feature by .ifLet(state: .$destination, action: .destination)
Yes, I have tried to use just callback effects from child features, detect them in parent reducer and set destination nil and it works well. But I want to use more simple way and exactly want to understand why this bug reproduce
Checklist
main
branch of this package.Expected behavior
After dismiss() set nil for only one(child) feature
Actual behavior
After dismiss() set nil for two(parent and child) features
Steps to reproduce
I can't share all my project, because it's not mine and I don't have this opportunity, but I can share with you some logs and results
I will share with you two variants of my app. And this variants have only one difference 1) With bug. I have this sending line on View that is connected with child feature
2) No bug. I commented this sending line
This action "test" isn't detected on any reducers, so it can't influence for something
1) test1.txt
2) test2.txt
You can also pay your attention to logs like this "<decode: bad range for [%@] got [offs:346 len:932 within:0]>". I'm sure that this error log is connected with the problem
The Composable Architecture version information
1.9.0
Destination operating system
iOS 17.3
Xcode version information
15.2
Swift Compiler version information