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

Unloading models can leave stale fragments w/ ember-data-2.13 #261

Closed
workmanw opened this issue May 5, 2017 · 2 comments
Closed

Unloading models can leave stale fragments w/ ember-data-2.13 #261

workmanw opened this issue May 5, 2017 · 2 comments

Comments

@workmanw
Copy link
Contributor

workmanw commented May 5, 2017

Steps:

  1. pushPayload that includes a model with embedded fragment
  2. find the record and get a property on the embedded fragment.
  3. unload model
  4. pushPayload again for the same model
  5. find the same record again and try to use the embedded fragment. You'll find it's destroyed and no longer observable.

I bisected the issue and found this beastly commit is the culprit: emberjs/data@2f18405 ... I really have no idea where to begin 😢

@workmanw
Copy link
Contributor Author

workmanw commented May 5, 2017

Here is the PR for it: emberjs/data#4593

@workmanw
Copy link
Contributor Author

workmanw commented May 5, 2017

Okay, I've fully grokked the PR and resurrected all the ember-data internals knowledge from the cold storage part of my brain 😜 . This seems to be related to relationships. It seems that internalModels w/ a relationship are preserved when unloadRecord is called. So we need to do a better job at cleaning up.

Let me see if I can write a failing test now that I understand what's happening.

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

No branches or pull requests

1 participant