Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router : default transition affecting effective routing #22

Open
ghost opened this issue Jul 23, 2018 · 3 comments
Open

Router : default transition affecting effective routing #22

ghost opened this issue Jul 23, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 23, 2018

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.

@tibastral
Copy link
Contributor

@ghivert can you look at that problem ?

Thank you so much !

@tibastral
Copy link
Contributor

And a SSCE would be really helpful !

@ghivert
Copy link
Contributor

ghivert commented Jul 30, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants