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 Failing in Engine with Loading Template #15051

Open
spencer516 opened this issue Mar 21, 2017 · 0 comments
Open

Sticky Query Params Failing in Engine with Loading Template #15051

spencer516 opened this issue Mar 21, 2017 · 0 comments

Comments

@spencer516
Copy link
Contributor

This PR ended up presenting some issues in my application after updated to v2.12.0 and Ember-Engines v0.5.0: #14794

It does look like this might be an existing and known issue (see #12107) – however, because I am only experiencing this with an Engine and only after upgrading, I figured it was worth opening a new issue.

I've created a failing test that reproduces the issue here: #15050

A quick explanation (this is the same example in the failing test case):

Let's say we have this routes.js file in our engine:

this.route('contributor', { path: 'contributor/:id' }, function() {
  this.route('posts');
  this.route('profile');
});

And, our contributor controller has a queryParameter of simplified, which is currently set to the non-default value of true.

Also, contributor/posts has a slow-loading model and we have a loading template at contributor/loading.hbs.

contributor/posts.hbs also has a template which contains a link to profile: {{#link-to "blog.contributor.posts"}}Posts{{/link-to}}

If we navigate to contributor/1/posts?simplified=true, then the link to blog.contributor.posts will not contain the simplified=true queryParameter as expected.


The best I could figure out was that during the intermediateTransitionTo (which is the initial transition), the query parameter cache key includes undefined when it should contain the id of the model for contributor (1 in this case).

In fact, the test will pass if we navigate to contributor/undefined/posts?simplified=true as it tricks the qpCache key.

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

3 participants