TransitionTo with queryParams refreshModel triggers model calls on other routes
See original GitHub issueDescription
It appears that calling transitionTo with queryParams on a nested route can trigger calls to the lower route if that route has a refreshModel: true on an unchanged queryParam. Reproduction
So I have this setup:
somewhere -> somewhereParam with refreshModel: true with default null
somewhere.nested -> nestedParam
In somewhere.nested I have a component which triggers a transition on the router service where nestedParam is changed. This trigger the model on somewhere to be called and then transitioning through the controller then triggers another call.
Cause
I did some digging and it appears that the call to route#finalizeQueryParamChange returns the incorrect values, because the transition._keepDefaultQueryParams isn’t set. This is set in router#transitionTo, but only after the call. The call does return a promise, so transition._keepDefaultQueryParams = true may actually be executed in time, but I found this to be very flaky.
I’m more than willing to help fix this, however it is embedded so deeply that I find it difficult to pick the right approach.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:24
- Comments:14 (3 by maintainers)

Top Related StackOverflow Question
@rwjblue This bug is currently 50 days old. While I understand effort is currently going to Ember 3.0, I hope we can get this fixed within reasonable time for the LTS releases.
I just came across this bug on Ember 3.3. Using the router service’s
transitionTomethod in a component would cause the transitioned-to route’s model hook to be called twice. My workaround was to pass an action defined in the controller down to the component and use the controller’stransitionToRoutemethod which does not seem to have the bug.