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

Sticky query params broken with loading substate #12107

Closed
tobymarsden opened this issue Aug 14, 2015 · 8 comments
Closed

Sticky query params broken with loading substate #12107

tobymarsden opened this issue Aug 14, 2015 · 8 comments

Comments

@tobymarsden
Copy link

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/

@tobymarsden
Copy link
Author

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

@workmanw
Copy link

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
Copy link

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

@sunsetlincoln
Copy link

@thijsvdanker Should //this.transitionTo({ queryParams: { two: 'two' }}); be uncommented in main-route.js to demonstrate the issue?

@thijsvdanker
Copy link

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

@thijsvdanker
Copy link

@sunsetlincoln refactor is done, both transitions now take place in routes/main-route.js

@akashdsouza
Copy link

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.

@rwjblue
Copy link
Member

rwjblue commented Nov 6, 2020

The reproduction test from @rlivsey (in #16986) was landed in #19249.

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

6 participants