wwt / SwiftCurrent

A library for managing complex workflows in Swift
https://wwt.github.io/SwiftCurrent/
Apache License 2.0
307 stars 19 forks source link

[Bug]: navigate to an empty view under conditional flow #209

Closed dulllight closed 2 years ago

dulllight commented 2 years ago

Navigate to an empty view under conditional flow with presentation type of navigationLink

Hi, Today I notice a strange behavior. In screen A, there is a toggle. If toggle is on, press "Next", it would lead to screen B. If off, to screen C. If the presentationTyp is navigationLink or modal, when toggle is off, if press "Next", it would not lead to screen C but an empty view. Would you please help check what might cause this issue? Many thanks.

Version

SwiftCurrent 5.1.5 Xcode 13.3.1

Relevant code sample

WorkflowView(launchingWith: model) {
    WorkflowItem(FirstView.self)  // toggle inside
        .presentationType(.navigationLink)
    WorkflowItem(SecondView.self) //  when toggle is on, it would lead to here
        .presentationType(.navigationLink)
    WorkflowItem(ThridView.self) // when toggle is off, it would lead to here
        .presentationType(.navigationLink)
    WorkflowItem(FourthView.self)
        .presentationType(.navigationLink)
    WorkflowItem(FifthView.self)
        .presentationType(.navigationLink)
)

Relevant log output

No response

Code of Conduct

Tyler-Keith-Thompson commented 2 years ago

I'll look into reproducing this, while I do is your WorkflowView inside a NavigationView?

dulllight commented 2 years ago

No. I didn't embed them in a navigation view. And this issue could also be reproduced with a modal presentation. BTW, Just now I tried with ver4.5.24 and everything is going fine.

获取 Outlook for iOShttps://aka.ms/o0ukef


发件人: Tyler Thompson @.> 发送时间: Monday, August 1, 2022 1:41:39 PM 收件人: wwt/SwiftCurrent @.> 抄送: dulllight @.>; Author @.> 主题: Re: [wwt/SwiftCurrent] [Bug]: navigate to an empty view under conditional flow (Issue #209)

I'll look into reproducing this, while I do is your WorkflowView inside a NavigationView?

― Reply to this email directly, view it on GitHubhttps://github.com/wwt/SwiftCurrent/issues/209#issuecomment-1200734196, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIWIA3QYGVZSC7PBMUZIGLVW5PRHANCNFSM55GCDKCQ. You are receiving this because you authored the thread.Message ID: @.***>

Tyler-Keith-Thompson commented 2 years ago

SCRepro.zip

I was able to reproduce the issue. I'll look into a fix, but I'm posting the reproduction in case somebody else can get to it faster.

dulllight commented 2 years ago

Thanks for the confirmation.

获取 Outlook for iOShttps://aka.ms/o0ukef


发件人: Tyler Thompson @.> 发送时间: Tuesday, August 2, 2022 5:14:47 AM 收件人: wwt/SwiftCurrent @.> 抄送: dulllight @.>; Author @.> 主题: Re: [wwt/SwiftCurrent] [Bug]: navigate to an empty view under conditional flow (Issue #209)

SCRepro.ziphttps://github.com/wwt/SwiftCurrent/files/9237451/SCRepro.zip

I was able to reproduce the issue. I'll look into a fix, but I'm posting the reproduction in case somebody else can get to it faster.

― Reply to this email directly, view it on GitHubhttps://github.com/wwt/SwiftCurrent/issues/209#issuecomment-1201728713, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIWIAZU36UYJ5MSZVAOITLVXA44PANCNFSM55GCDKCQ. You are receiving this because you authored the thread.Message ID: @.***>

Tyler-Keith-Thompson commented 2 years ago

Alright! The branch fix-209 has the correct behavior. I still need to get tests updated and fix a couple pipeline things before I can release.

Tyler-Keith-Thompson commented 2 years ago

Fixed in 5.1.6