-
-
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
[BUGFIX release] Don’t leak container while injection deprecated cont… #15142
Conversation
The approach looks good, but there is some sort of failure still... |
packages/container/lib/container.js
Outdated
// TODO - remove when Ember reaches v3.0.0 | ||
function injectDeprecatedContainer(object) { | ||
if ('container' in object) { return; } | ||
Object.defineProperty(object, 'container', INJECTED_DEPRECATED_CONTAINER_DESC); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 dont worry, i was just short on time I'll take a look once im home.container.owner
to be null? Is that a test config error?
There was a problem hiding this comment.
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.
1509453
to
e9982b3
Compare
@rwjblue / @krisselden fixed, ready for review |
e9982b3
to
e951128
Compare
There was a problem hiding this 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
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? |
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 |
…ainer