Related to #11857:
If a route has a dynamic segment, a query parameter, a child route with a slow-loading model and a loading template, the query parameter is no longer sticky.
As far as I can trace back, transition inside setup on Route is null, when it shouldn't be.
Here's a fiddle (Ember Canary) with no loading substate, which has the correct sticky query params:
http://jsfiddle.net/tobymarsden/x0rngqL2/
And here's a fiddle with a loading substate added, where the query params are no longer sticky:
http://jsfiddle.net/tobymarsden/963qt5p9/
Fiddles moved to Ember-Twiddle and updated to Ember 2.1.0:
Here sticky query params are working:
https://ember-twiddle.com/91e7b67f87afc0836c4f
A loading template is added, and now query params are not sticky:
https://ember-twiddle.com/5b5a761bf8ea50365d80
It's possible that #10945 is also related. It's kind of similar in that a transition inside of an existing transition usually (always?) results in an abort call. Though because this is complicated, I can't say for sure.
I'm having the same problem and created these twiddles:
Both a dynamic segment and a loading template => bug
https://ember-twiddle.com/63153573fe0150b655613b0ce5e83771?openFiles=templates.main-route.hbs%2C
Only dynamic segment, no loading template => works
https://ember-twiddle.com/c8a25c0d17cd05119360fc470eba6d3c?openFiles=templates.main-route.hbs%2C&route=%2Fparent%2Fsub-route
Only loading template, no dynamic segment => works
https://ember-twiddle.com/5571992920996228f84bbe06cf7cdb26?openFiles=templates.main-route.hbs%2C&route=%2Fparent%2Fsub-route
@thijsvdanker Should //this.transitionTo({ queryParams: { two: 'two' }}); be uncommented in main-route.js to demonstrate the issue?
@sunsetlincoln the second transition is done in the main-route controller at this moment (reflecting my own code-base). I'll refactor it to the route to better demonstrate the issue.
@sunsetlincoln refactor is done, both transitions now take place in routes/main-route.js
I'm having the same issue as well. From what I can tell, values being null in here is what's causing the incorrect cache key to be set. While transitioning to a slow model with loading template, the transition object is undefined in the parent route's setup method and this condition is never fulfilled.
The reproduction test from @rlivsey (in #16986) was landed in https://github.com/emberjs/ember.js/pull/19249.
Most helpful comment
I'm having the same problem and created these twiddles:
Both a dynamic segment and a loading template => bug
https://ember-twiddle.com/63153573fe0150b655613b0ce5e83771?openFiles=templates.main-route.hbs%2C
Only dynamic segment, no loading template => works
https://ember-twiddle.com/c8a25c0d17cd05119360fc470eba6d3c?openFiles=templates.main-route.hbs%2C&route=%2Fparent%2Fsub-route
Only loading template, no dynamic segment => works
https://ember-twiddle.com/5571992920996228f84bbe06cf7cdb26?openFiles=templates.main-route.hbs%2C&route=%2Fparent%2Fsub-route