Skip to content

router.reset() doesn't clear the PipelineProvider #465

@arnederuwe

Description

@arnederuwe

I'm submitting a bug report

  • Library Version:
    1.1.1

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    6.9.1

  • NPM Version:
    3.10.8
  • Browser:
    all

  • Language:
    TypeScript 2.1

Current behavior:
When calling aurelia.setRoot(), this function resets the router. This way you can have 2 different route configs in your different app roots without manually having to clear the router when switching app roots. Right now the steps attached to the router remain active, causing bugs with authorisationSteps. I described my specific issue in detail in the following StackOverflow post: http://stackoverflow.com/questions/41956911/router-authorizestep-from-other-app-root-keeps-triggering

Expected/desired behavior:

  • What is the expected behavior?
    an aurelia.setRoot() should also do a pipelineProvider.reset()
    Unless i'm missing something, this can even be included in the router.reset() function

  • What is the motivation / use case for changing the behavior?
    It took some searching to figure out why my authorizeStep was still executing in another app root. I don't think the behavior is logical, when you switch roots, you want a whole 'new' router, without any steps you attached in another root.

If this can be fixed by just including the pipelineProvider.reset() into the router.clear() function, I would be happy to make a pull request for it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions