Skip to content

Immediate dismiss during quick view update #98

@JanRajtr

Description

@JanRajtr

Description

In case of a quick view update during the navigation, the view is dismissed immediately.

How to simulate
Just have this view which automatically move to another view:

struct TestView1: View {
  
  @EnvironmentObject var navigator: FlowPathNavigator
  @State var someValue: Int = 0

  var body: some View {
    VStack {
      
      Text("TestView1")
    }
    .onChange(of: someValue) {
      navigator.push(NavigationtRoute.second)
    }
    .onAppear {
      DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
        someValue = 2
      }
    }
  }
}

From user perspective it looks like:

Image

Note

After a brief debugging it seems the problem probably comes from the RoutesHolder and the way how it holds the route values in relation to the scheduler for remaining steps. If you put breakpoints on certain places where the routes are updated, such as RoutesHolder.swift L21, you may notice the routes are actually updated more than once in the one push transaction. Log of that would look like:

UPDATED AT: 2025-05-19 08:44:25 +0000
UPDATED AT: 2025-05-19 08:44:25 +0000
UPDATED AT: 2025-05-19 08:44:47 +0000
UPDATED AT: 2025-05-19 08:44:47 +0000
ROUTE COUNT: 2
UPDATED AT: 2025-05-19 08:44:49 +0000
UPDATED AT: 2025-05-19 08:45:05 +0000
UPDATED AT: 2025-05-19 08:45:05 +0000
ROUTE COUNT: 1
ROUTE COUNT: 1
UPDATED AT: 2025-05-19 08:45:11 +0000

This may not be necessarily the issue, but while this debugging using breakpoints you may notice that the there is even more pushes and dismissals, which are probably just omitted by the system itself if breakpoints are disabled.
Image

Unfortunately I don't have enough capacity to debug more and give more detailed info at the moment. Also the mentioned above might be a wrong assumption, so please do not take it as a right direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions