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

Aborting a transition with queryParams still triggers fireQueryParamDidChange #323

Open
jdkahn opened this issue Mar 30, 2021 · 2 comments

Comments

@jdkahn
Copy link

jdkahn commented Mar 30, 2021

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) ?

@patrickberkeley
Copy link

@jdkahn does #303 describe the same issue you are seeing?

@jdkahn
Copy link
Author

jdkahn commented Jun 9, 2021

@patrickberkeley I don't believe they are the same issue. It appears to me that #303 is talking about when a QP-only transition interrupts an existing transition, and that the old transition should abort. In my case we manually abort a transition with QP, but is not a QP-only 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