Ember.js: Sticky query params broken with loading substate

Created on 15 Aug 2015  路  8Comments  路  Source: emberjs/ember.js

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.

12037 fixed the JS error that was occurring in #11857, but didn't fix the underlying problem.

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/

Needs Bug Verification Query Params

Most helpful comment

All 8 comments

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.

@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.

Was this page helpful?
0 / 5 - 0 ratings