-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Route with store.findAll not working correctly if records of that type already present from previous page #12488
Comments
I suspect this is related to the ArrayProxy / |
Thanks @stefanpenner I would have posted their straight away but because findAll seemed to be returning the data I would expect I wanted a quick opinion from here first. Posted as emberjs/data#3863 |
Ok, I'll try and put an example app together now, nearing the end of the working day here in the UK so it may be Monday that I finish and post a link. |
@stefanpenner here is an example app that shows it https://github.com/adam-knights/order-example-oct-2015
Let me know if you see the bug too or if you need any more information? |
Update: Issue still occurs in Ember 2.2.0 |
The issue is with the background refresh behavior of ember data.
FindAll resolves straight away with a background refresh then happening, changing the routes to
Resolves the issue. I've opened emberjs/data#4148 to cover whether I should have got a deprecation warning about using then on findAll - as the new behavior resolves immediately if there are existing records. |
This was working fine with Ember 1.13.10 and Ember Data 1.13.12, doesn't seem to work with Ember 2.1.0 and Ember data 2.1.0.
If I navigate to http://localhost:4200/orders then it works fine and I see 6 orders come in from the api and the page displays information on all seven orders.
If I first navigate to http://localhost:4200/members/1234/orders, then I correctly see 3 orders from that member account. However, if I now press the link to goto http://localhost:4200/orders it only displays the same 3 orders. The api is deffinitely hit again and it correctly returns 6 orders.
I put a breakpoint at the end of Ember Data's _findAll method and its returning an array with 6 items from the
return store.peekAll(modelName);
line. So I've posted here first as I think Ember data has done its job?This is my orders route:
This is my account (member) model:
This is my order model:
The text was updated successfully, but these errors were encountered: