-
-
Couldn't load subscription status.
- Fork 1.7k
fix(browser): Fix memory leak in addEventListener instrumentation
#5147
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
Conversation
size-limit report 📦
|
b3f526f to
9818be5
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.
Awesome stuff!
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.
Simple fix, yet so much value-added through great tests. Thanks 🙏
We currently have a memory leak in the instrumentation of
addEventListenerin@sentry/browser. It happens when users provide an object as event listener toaddEventListener. ThehandleEventfunction gets wrapped and instrumented each time the listener is attached somewhere.This PR:
addEventListenerin the futureFixes #2957
Ref: https://getsentry.atlassian.net/browse/WEB-916
Reproduction of the memory leak