-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't working due to a bug in the library.Something isn't working due to a bug in the library.
Description
Description
Steps to reproduce:
- Start in .online state
- Present a sheet
- Start a timer effect that will call dismiss() after 5 seconds
- Transition to .offline state (timer gets cancelled as expected - "cancelled" prints)
- Transition back to .online state (timer restarts via .send(.online(.modal(.presented(.sheet(.timer))))))
- After 5 seconds, "will dismiss" prints but the sheet remains visible
DismissEffectBehavior.mov
Checklist
- I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
- If possible, I've reproduced the issue using the
mainbranch of this package. - This issue hasn't been addressed in an existing GitHub issue or discussion.
Expected behavior
Expected: The sheet should dismiss after the timer completes.
Actual behavior
Actual: The dismiss dependency has no effect, sheet remains visible.
Reproducing project
There are several options to solve that
- Dismissing modal by setting modal state to nil from parent reducer.
- Having dynamic ID for the sheet modal and resetting it to different id after parent status change.
My real case is much complex and there are some reasons to have module based identity instead of instance based identity for this specific case I want SwiftUI to recognize it's the same presentation semantically, even if the parent state transitions.
The Composable Architecture version information
1.23.1
Destination operating system
iOS 26.1
Xcode version information
Version 26.1.1 (17B100)
Swift Compiler version information
swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Target: arm64-apple-macosx26.0Metadata
Metadata
Assignees
Labels
bugSomething isn't working due to a bug in the library.Something isn't working due to a bug in the library.