athlete icon indicating copy to clipboard operation
athlete copied to clipboard

Router : default transition affecting effective routing

Open ghost opened this issue 5 years ago • 3 comments

Context

I have a handleHistory function to help with routing. It is used in particular to handle logging out, in which case the destination (To route) points to the route of the login page ; and also the 'Back' function.

handleHistory : DirectionMsg -> MyHistory -> MyHistory
    handleHistory (To route) history =
    history |> push (Router.pageWithDefaultTransition route)

Symptom

The log out action triggers an infinite list of StandardHistoryMsg (Tick Int) or lands in another page. The following change to handleHistory (from pageWithDefaultTransition to pageWithoutTransition) make the application behave correctly.

handleHistory : DirectionMsg -> MyHistory -> MyHistory
    handleHistory (To route) history =
    history |> push (Router.pageWithoutTransition route)

No other change occurred between op / not op, and the symptom is reproductible.

Hints

Router.push has a case switch relative to this (isRunning transition). Router.push updates a transition field of a History value.

ghost avatar Jul 23 '18 12:07 ghost

@ghivert can you look at that problem ?

Thank you so much !

tibastral avatar Jul 30 '18 10:07 tibastral

And a SSCE would be really helpful !

tibastral avatar Jul 30 '18 10:07 tibastral

Could you do an SSCCE? Without it, it's really complicated to understand what could bug. Or at least, could you show your flow in order to understand what's happening earlier and after transition.

ghivert avatar Jul 30 '18 10:07 ghivert