Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismiss more than one feature #3031

Closed
2 of 3 tasks
nmalevich opened this issue Apr 30, 2024 · 2 comments · Fixed by #3037
Closed
2 of 3 tasks

Dismiss more than one feature #3031

nmalevich opened this issue Apr 30, 2024 · 2 comments · Fixed by #3037
Labels
bug Something isn't working due to a bug in the library.

Comments

@nmalevich
Copy link

Description

I use tree-based navigation provided TCA. In some cases I need to dismiss to root feature. It works, but I see runtime warning about dismiss action that not handled because feature is nil.
I'm not sure that it's bug, but don't know how to remove this warning

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.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

You dismiss to root feature and not see runtime warning

Actual behavior

You dismiss to root feature and see runtime warning

Steps to reproduce

LongDismissExample.zip

  1. You tap "Forward" button on the First screen and go to the Second
  2. You tap "Forward" button on the Second screen and go to the Third
  3. You tap "Back" button on the Third screen and return to the First
  4. You see runtime warning

The Composable Architecture version information

1.10.1

Destination operating system

iOS 17.4

Xcode version information

15.3

Swift Compiler version information

swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
@nmalevich nmalevich added the bug Something isn't working due to a bug in the library. label Apr 30, 2024
stephencelis added a commit that referenced this issue Apr 30, 2024
Currently, popping two layers in a nav tree will cause intermediate,
invalid stores to send `dismiss` actions when they shouldn't. This
branch avoids this by checking the store's validity before sending the
action along.

Fixes #3031.
stephencelis added a commit that referenced this issue Apr 30, 2024
Currently, popping two layers in a nav tree will cause intermediate,
invalid stores to send `dismiss` actions when they shouldn't. This
branch avoids this by checking the store's validity before sending the
action along.

Fixes #3031.
@stephencelis
Copy link
Member

Thanks for the report! We'll be suppressing that warning in the next release, which should come later today.

I'll note that SwiftUI doesn't support nested navigation destinations like this very well, so you may want to consider stack navigation in the future, but if it works for you and the OSes you deploy to, at least you should be warning-free soon 😄

@nmalevich
Copy link
Author

Thank you too!
I will consider using stack navigation soon, thanks one more time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working due to a bug in the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants