You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the provided sample project, the app's root view's task action, the RootFeature, appends a feature state (DetailFeature) to the navigation path on the app's NavigationStack. When pressing the DetailFeature's close button, it calls the DismissEffect. The detail view, however, doesn't get dismissed. I figured out this is because the NavigationStack's root view (HomeView) awaits the send action to finish in the task view modifier.
Checklist
I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
If possible, I've reproduced the issue using the main branch of this package.
We are also experiencing this issue and I really don't think using await store.send(.task).finish() in one view should cause DismissEffect to fail in another! It seems to me like a bug in TCA navigation that such actions at a distance can occur at all.
At least I think we need better documentation and test coverage on the semantics of cancellation with the navigation utilities. The current implementation seems to set up and remove cancellation handlers quite (overly?) deliberately1.
While studying the issue, I found at least one workaround which seems to fix the above sample project, but I don't fully understand why:
I couldn't find time to investigate deeper but I can clearly see idsAfter and idsBefore are same in _StackReducer.reduce function when closeButtonTapped is called in the demo.
Description
In the provided sample project, the app's root view's task action, the RootFeature, appends a feature state (DetailFeature) to the navigation path on the app's NavigationStack. When pressing the DetailFeature's close button, it calls the
DismissEffect
. The detail view, however, doesn't get dismissed. I figured out this is because the NavigationStack's root view (HomeView) awaits the send action to finish in the task view modifier.Checklist
main
branch of this package.Expected behavior
The view pushed onto the NavigationStack should pop when calling
dismiss
.Actual behavior
The view is not getting removed from the stack.
Reproducing project
Sample project: dismiss.zip
The dismiss is not working when using
.task { await store.send(.task).finish() }
in HomeView (which is the NavigationStack root view):The dismiss only works when just using
.task { store.send(.task) }
in HomeView.The Composable Architecture version information
1.17.0
Destination operating system
iOS 18
Xcode version information
Xcode version 16.0 (16A242d)
Swift Compiler version information
The text was updated successfully, but these errors were encountered: