You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the in-viewport service's watchElement function (code), you protect the creation of observerAdmin, making sure you don't create if you already have one.
I'm not positive that this is the cause of our leaks, but the loss/overwrite of the observer admin reference, which holds the registry that IS our leak, is making it hard to make any sort of fix.
Assuming this is the problem I think it might be, the right solution here might be to protect creation of observerAdmin inside startIntersectionObserver rather than its callers. I've made that locally while I debug things.
Happy to PR that in, but to be honest, I've been debugging a straight line to the leak and I've ignored some of what I've debugged through, so I may be missing a reason for re-creation of the observerAdmin
The text was updated successfully, but these errors were encountered:
Also, for future reference, the Mixin will surely be deprecated in the future. The service is the recommended path forward just in case I haven't stated it in the README.
dbashford
pushed a commit
to dbashford/ember-in-viewport
that referenced
this issue
Dec 19, 2019
I'm debugging some leak issues we have using ember-in-viewport. While I haven't got to the source just yet, I did notice this...
In the
in-viewport
service, you have astartIntersectionObserver
function which instantiates anObserverAdmin
(code).In the
in-viewport
service'swatchElement
function (code), you protect the creation ofobserverAdmin
, making sure you don't create if you already have one.However, in the
_setInitialViewport
function of thein-viewport
mixin (code) you callstartIntersectionObserver
without such a protection.I'm not positive that this is the cause of our leaks, but the loss/overwrite of the observer admin reference, which holds the registry that IS our leak, is making it hard to make any sort of fix.
Assuming this is the problem I think it might be, the right solution here might be to protect creation of
observerAdmin
insidestartIntersectionObserver
rather than its callers. I've made that locally while I debug things.Happy to PR that in, but to be honest, I've been debugging a straight line to the leak and I've ignored some of what I've debugged through, so I may be missing a reason for re-creation of the
observerAdmin
The text was updated successfully, but these errors were encountered: