-
-
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
multiple calls to peekAll and unloadAll put store into inconsistent state #5167
Comments
Failing test: #5168 |
It seems related to me also. I also have #5157 which could be a different flavor of the same problem. |
Hello, I think have a similar issue with the
But it doesn't seems to unload my record at all, the only way I find out to unload my record is :
This method work, but I'm losing some other record in my store too, which is something not intended. Also, it worked with [email protected]. |
I confirmed that this is fixed by #5378 and added a test in case it were to resurface. |
This seems similar to #5111, perhaps a duplicate.
edit: First observed using ember data version
2.14.11
and reproduced on2.16.0-canary
.I have 2 models, one of which
hasMany
of the other, and I noticed that after repeating a flow that involved callingunloadAll
to remove the child elements and thenpushPayload
to add new ones, the store started reporting inconsistent results for bothpeekAll
andparentModel.get('childModels.length')
.For example, if the models are Person and Car and Person has-many cars (and car belongs-to person), the following code puts the store into the inconsistent state:
This unexpected behavior appears to be related to using
peekAll
+forEach
to set the parent property on the peeked records. If the lines in the code snippet above that callcar.set('person', person)
are removed, things behave as expected.The text was updated successfully, but these errors were encountered: