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

transition.abort() does not work for query param only transitions #18568

Closed
normanhaze opened this issue Nov 22, 2019 · 7 comments
Closed

transition.abort() does not work for query param only transitions #18568

normanhaze opened this issue Nov 22, 2019 · 7 comments

Comments

@normanhaze
Copy link

When calling transition.abort() on a transition which only changes the query params, the transition goes ahead anyway. I am using the ‘routeWillChange’ event in the router service to intercept the transition. transition.abort() is called but does not prevent the params change.

Perhaps a slightly different issue, but transition.abort() also triggers the ‘routeWIllChange’ event again, with some confusing properties. ‘isAborted’ is true, ‘isCausedByAbortingTransition’ is false, and the ‘to’ and ‘from’ objects both point to the original ‘from’ query params, not the new query params. If nothing else, surely an aborted transition shouldn’t be triggering the ‘routeWillChange’ event?

@jelhan
Copy link
Contributor

jelhan commented Nov 25, 2019

I'm seeing a similar issue. Didn't noticed this one exists before I had written it down. Maybe my long explanation will be helpful.

Edit: Think mine is slightly different and related to many other issues. Opened it as a separate issue: #18577

@acorncom
Copy link
Contributor

@normanhaze what version of Ember are you seeing this in? And are you able to send in a reproduction to make it easier to track this down?

@normanhaze
Copy link
Author

Hi @acorncom - I'm using 3.13, but I've created a demo app using 3.15 and the issue is still there. Take a look: https://github.com/normanhaze/transition-issue-demo

A 'routeWillChange' event is set in the component's constructor, which triggers when the queryParams change (when you click the button).

The first transition has the correct 'from' and 'to' query params, and appears to be aborted, and the event triggers again with a new transition. The 'from' and 'to' query params are both for the current route. This is not aborted due to the check for the 'isAborted' property. However, the query params change to the original target anyway.

@omairvaiyani
Copy link

Hi guys, this issue should have Needs reproduction label removed as it is reproducable using that repo posted by @normanhaze

@acorncom
Copy link
Contributor

thanks @normanhaze / @omairvaiyani, updated

@rwjblue
Copy link
Member

rwjblue commented Jul 20, 2020

Fixed by #19048 (thanks @richgt!).

@rwjblue rwjblue closed this as completed Jul 20, 2020
@patrickberkeley
Copy link

patrickberkeley commented May 21, 2021

I'm seeing this issue again after upgrading to ember 3.26.1, at least when the transition is triggered by the LinkTo component.

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

No branches or pull requests

7 participants