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

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

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

svennergr
Copy link
Contributor

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.

@svennergr svennergr added the type/bug Something isn't working label Jul 16, 2024
@svennergr svennergr merged commit c8fac96 into main Jul 17, 2024
3 checks passed
@svennergr svennergr deleted the svennergr/fix-lazyloader-callback branch July 17, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants