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

[BUGFIX release] Don’t leak container while injection deprecated cont… #15142

Merged
merged 2 commits into from
Apr 16, 2017

Conversation

stefanpenner
Copy link
Member

…ainer

@rwjblue
Copy link
Member

rwjblue commented Apr 14, 2017

The approach looks good, but there is some sort of failure still...

// TODO - remove when Ember reaches v3.0.0
function injectDeprecatedContainer(object) {
if ('container' in object) { return; }
Object.defineProperty(object, 'container', INJECTED_DEPRECATED_CONTAINER_DESC);
Copy link
Member Author

@stefanpenner stefanpenner Apr 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I need to actually set the container again here setOwner(object, container)

Copy link
Member Author

@stefanpenner stefanpenner Apr 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like container.owner is null for the offending tests. and this PR closing over container masked that.

@rwjblue do i expect container.owner to be null? Is that a test config error? dont worry, i was just short on time I'll take a look once im home.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll actually investigate more, just gotta head out now.

@stefanpenner stefanpenner force-pushed the dont-leak-container branch 2 times, most recently from 1509453 to e9982b3 Compare April 16, 2017 17:54
@stefanpenner
Copy link
Member Author

@rwjblue / @krisselden fixed, ready for review

@stefanpenner stefanpenner merged commit 32da960 into master Apr 16, 2017
@stefanpenner stefanpenner deleted the dont-leak-container branch April 16, 2017 21:33
Copy link
Contributor

@krisselden krisselden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we setting override instead of setOwner? Also, the owner is supposed to be the app instance and likely that test didn't have an app instance. Object in the above is the prototype with no double extend so this would still leak

@stefanpenner
Copy link
Member Author

Because the original code was explicitly returning the container (Not whatever the owner happened to be) I didn't want to change behavior for a leak fix.

I think as a next step we should likely just remove this code entirely in canary, thoughts?

@stefanpenner
Copy link
Member Author

Or a better question, what would need to be done to remove this in canary? It may just be update the deprecation message in release/beta

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

Successfully merging this pull request may close these issues.

3 participants