pointfreeco / swift-composable-architecture

A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
https://www.pointfree.co/collections/composable-architecture
MIT License
12.35k stars 1.44k forks source link

Dismiss more than one feature #3031

Closed nmalevich closed 5 months ago

nmalevich commented 5 months ago

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

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)
stephencelis commented 5 months ago

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 :smile:

nmalevich commented 5 months ago

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