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

unloadRecord destroys manyArray #4835

Closed
hjdivad opened this issue Mar 2, 2017 · 6 comments
Closed

unloadRecord destroys manyArray #4835

hjdivad opened this issue Mar 2, 2017 · 6 comments
Assignees

Comments

@hjdivad
Copy link
Member

hjdivad commented Mar 2, 2017

see https://github.com/emberjs/data/blob/master/addon/-private/system/relationships/state/has-many.js#L59-L65

presumably the right behaviour is to issue a change event for that index and then call it a day.

cc @stefanpenner @igorT

@hjdivad hjdivad self-assigned this Mar 2, 2017
@BryanCrotaz
Copy link
Contributor

surely the many array is the bit that's using RAM so we do want to destroy it on unload?

@stefanpenner
Copy link
Member

@BryanCrotaz I believe in this case when a single belongsTo is unloaded, it destroys any hasMany pointing to it, forcing it to be invalidated and totally rebuilt when accessed.

@BryanCrotaz
Copy link
Contributor

Ah that's a Bad Thing.

@BryanCrotaz
Copy link
Contributor

although when the last belongsTo is unloaded, this should happen

@stefanpenner
Copy link
Member

@BryanCrotaz well it should become empty, but the hasMany should stick around until it's record is unloaded/destroyed

@runspired
Copy link
Contributor

This was resolved by #5273 and other more recent fixes to the relationship layer.

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

4 participants