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

Dynamic Segments / Query Params / Loading State Produces error with cacheValuePrefix #11857

Closed
spencer516 opened this issue Jul 21, 2015 · 7 comments · Fixed by #12037
Closed

Comments

@spencer516
Copy link
Contributor

If a route has a Dynamic Segment, a query parameter, a Child Route with a slow-loading model and a loading template, an error occurs when a non-default query parameter is provided.

Please see http://emberjs.jsbin.com/xahiwi/edit?html,js,console,output

Clicking on the "CLICK ME!" button produces the error TypeError: null is not a valid argument for 'in' (evaluating 'cacheValuePrefix in values')

Error occurs here: https://github.com/emberjs/ember.js/blob/v1.13.5/packages/ember-routing/lib/ext/controller.js#L155

This error does not occur in 1.13.2, but occurs in 1.13.3 and after.

Likely culprit is: 78c0edb

@rwjblue
Copy link
Member

rwjblue commented Aug 3, 2015

@jmurphyau - Do you happen to have a little time to look into this one?

@jmurphyau
Copy link
Contributor

Yep - will do

@mike-north
Copy link
Contributor

Just hit this snag as well. Any way I can help expedite a fix?

@rwjblue
Copy link
Member

rwjblue commented Aug 8, 2015

@mike-north - I'd start along these lines:

  1. failing test case
  2. Understand what is failing and why
  3. try fixing

Any or all of the above items would be super helpful.

@jmurphyau
Copy link
Contributor

I seen that the issue is with cacheValuePrefix in values and my first instinct was to check if values was an object to fix this problem but I wanted to investigate if values being null was valid behaviour or not..

I didn't want to just chuck that check in and in doing so potentially hiding the actual problem..

Haven't had a chance yet but should get to this over the next few days

@jmurphyau
Copy link
Contributor

So I don't think values should actually be a null value - but wow the scenario/code path is so complex that I've just decided to solve the issue at hand rather then trying to troubleshoot/debug why it's null. See PR #12037

jmurphyau added a commit to jmurphyau/ember.js that referenced this issue Aug 10, 2015
Fixed an issue where cacheValuePrefix would incorrectly check "valA in valB" where valB would be null

Resolves Issue emberjs#11857
rwjblue pushed a commit that referenced this issue Aug 13, 2015
Fixed an issue where cacheValuePrefix would incorrectly check "valA in valB" where valB would be null

Resolves Issue #11857

(cherry picked from commit bfd52f0)
rwjblue pushed a commit that referenced this issue Aug 13, 2015
Fixed an issue where cacheValuePrefix would incorrectly check "valA in valB" where valB would be null

Resolves Issue #11857

(cherry picked from commit bfd52f0)
@tobymarsden
Copy link

The result of value being null is that query params are no longer sticky.

As far as I can trace back, transition inside setup on Route is null, when it shouldn't be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants