-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Describe the bug
In the TicTacToe example application, when you choose the SwiftUI application flow and opt into the Two Factor Auth. section, when you tap "Next" after typing in 1234
, the app with crash with the error:
Fatal error: "LoginAction.twoFactorDismissed" was received by an optional reducer when its state was "nil". This can happen for a few reasons:
with a long list of reasons as to why it's potentially crashed.
This crash appears to be caused by LoginSwiftView.swift
line num. 71. where the app sends .twoFactorDismissed
to the now nil'd out LoginState
, as the NavigationLink
receives false
for the isActive
binding.
To Reproduce
- Open the TicTacToe sample application
- Select SwiftUI version
- Enter
2fa@test.com
in the Email field - Enter
password
in the Password field - Tap Log in
- Enter
1234
and tap Submit - App navigates to the New Game screen, then immediately crashes
Expected behavior
I expected the app to progress to the New Game screen and not crash 😅
Environment
- Xcode 12.4
- Swift 5.3
- Composable Architecture version 0.15.0
Additional context
If you login with the 2FA flow through the UIKit version, it doesn't crash, and retains the login if you navigate backwards and switch to the SwiftUI version.