Skip to content

Aborting a transition with queryParams still triggers fireQueryParamDidChange #323

Open
@jdkahn

Description

@jdkahn

In Ember 3.20.1, I’m running into an issue when aborting a transition that has queryParams. Even though the transition is aborted, if the queryParams are watched by the target route, the current route is refreshed with the queryParams of the new transition. The issue seems to be related to emberjs/ember.js#18683, although in my case I think there is simple solution. The root cause seems to be in getTransitionByIntent of router_js/transition.

this.notifyExistingHandlers(newState, newTransition);

if (!wasTransitioning) {
    this.notifyExistingHandlers(newState, newTransition);          // triggers willTransition hook that holds the transition.abort() call
}
this.fireQueryParamDidChange(newState, queryParamChangelist!);     // not aware that the transition has been aborted

Would it be possible to wrap the fireQueryParamDidChange call in a check if (!newTransition.isAborted) ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions