Closed ampprojectbot closed 3 years ago
@samouri a possible issue?
I think this could happen when observe
and unobserve
both occur before the ioCallback
fires. That is the only way we could delete the callback before calling it. In this case, even though we are throwing an error it is likely harmless since we wouldn't want to fire the callback for a quickly unobserved element anyway.
We can solve simply with an if condition that checks for callback existence. Although that could potentially mask other issues. An alternative could be replacing the callback with a noop, or replacing the value with a "cancelled" object.
I'm leaning towards the simplest option (if check)
Details
Error report: link First seen: Nov 1, 2020 Frequency: ~ 7,391/day
Stacktrace
Notes
@samouri
modifiedsrc/viewport-observer.js:100-119
in #30761 (Oct 23, 2020)Seen in:
Possible assignees:
@samouri
/cc @ampproject/release-on-duty