-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Sideloaded records not available on init of model (behavior change between beta 19.2 and 1.13 series) #3545
Comments
Bumped into this too, the same bug existed on ember-data beta.18, I upgraded to ember-data 1.13.5 to see if it would fix and it did not. |
We are getting spurious requests for sideloaded models, too. |
Would it be possible to create a minimal JSBin demonstrating this issue? Without a component and observers? I'd be happy to dig into this but I'm having a hard time following the JSBins provided :( |
@wecc I figured out how to consistently trigger the issue, it wasn't as spurious as I'd at first supposed and I don't think it's something that ED should account for but which perhaps should be documented for users with partial records and sideloading. Let's say you have this /models/foo.js
Given the following record where none of the
Load the record as the model for a route
The
|
This looks like it was fixed on the ActiveModelAdapter repository, so we should backport the changes to 1.13. Here's an example that uses rawgithub.com to load the dist version of the active model adapter, but is working for this case. http://emberjs.jsbin.com/yezosubijo/1/edit?html,css,js,output |
Backporting the AMS changes to the release branch here. It'll land tomorrow in 1.13.6. #3564 |
you will see that in beta 19.2, the sideloaded records are available and that calling store.find doesnt send out an extra request
beta 19.2 http://emberjs.jsbin.com/yepilijuva/1/edit
in 1.13+ the behavior changes, the user count is 0 during the init process and eventually gets to 1 at a later point, so a request is sent out even though the record is sideloaded
http://emberjs.jsbin.com/duweqosizi/1/edit
i am thinking about losing the observer and instead making it a computed property which is prolly better suited at this point to guarantee the record is sideloaded first
http://emberjs.jsbin.com/fazejoviyu/1/edit
The text was updated successfully, but these errors were encountered: