grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
133 stars 20 forks source link

fix(lazyloader): fix trying to run inexistent callbacks #833

Closed svennergr closed 2 months ago

svennergr commented 2 months ago

Not a big sample size, but I saw this error in our app logs: https://ops.grafana-ops.net/a/grafana-lokiexplore-app/explore/service/Hosted%20Grafana%20-%20Prod/logs?patterns=%5B%5D&var-fields=&var-ds=grafanacloud-logs&var-filters=service_name%7C%3D%7CHosted%20Grafana%20-%20Prod&var-filters=kind%7C%3D%7Cexception&var-patterns=&var-lineFilter=%7C~%20%60%28%3Fi%29kl%5C.callbacks%5C%5Bt%5C.target%5C.id%5C%5D%20is%20not%20a%20function%60&var-logsFormat=%20%7C%20logfmt&urlColumns=%5B%5D&visualizationType=%22logs%22&var-labelBy=$__all&var-fieldBy=page_url&from=now-12h&to=now&timezone=browser

Basically trying to call an inexistent callback. By assumption is that it is a race condition, where the callback is deleted before the IntersectionObserver stopped observing. Thus, moving the deletion of callbacks after the unobserve call of the InteractionObserver and making sure the callback is a function.

grafanabot commented 2 months ago

:rocket: PR was released in v5.4.1 :rocket: