-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(angular): Remove afterSendEvent
listener once root injector is destroyed
#12786
Conversation
1c1690e
to
3bb8cc8
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.
Hey @arturovt thanks for opening this PR!
The fix makes sense to me so I'm happy to merge this. Any chance you could add a small test to cover this? We already have some tests for showReportDialog
in ErrorHandler
so something similar to these would be great:
describe('opens the report dialog if `showDialog` is true', () => { |
(Just a heads-up: I'm only assigning myself to the PR for internal tracking since I'm reviewing it)
afterSendEvent
listener once root injector is destroyedafterSendEvent
listener once root injector is destroyed
Small optimization using the new hook cleanup capabilities to remove unused hooks. Ref PR to do this in angular: #12786
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.
I added some tests to cover the cleanup logic since I had some time and I think we should get this out sooner than later.
Thanks for contributing once again ❤️
…destroyed In this commit, we added cleanup logic to handle the removal of `afterSendEvent`, which is set up within the Angular error handler. This fixes memory leaks that occur when the event is still being handled after the root view is removed.
eae93f2
to
ed22329
Compare
This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. See #12786 --------- Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com> Co-authored-by: Andrei Borza <andrei.borza@sentry.io>
In this commit, we added cleanup logic to handle the removal of
afterSendEvent
, which is set up within the Angular error handler. This fixes memory leaks that occur when the event is still being handled after the root view is removed.