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: Correctly remove all event listeners #2725

Merged
merged 1 commit into from Jul 7, 2020
Merged

Conversation

kamilogorek
Copy link
Contributor

Fixes #2724

@getsentry-bot
Copy link
Contributor

getsentry-bot commented Jul 7, 2020

Warnings
⚠️ Please add a changelog entry for your changes.
Messages
📖

@sentry/browser bundle gzip'ed minified size: (ES5: 17.1426 kB) (ES6: 16.2559 kB)

📖 ✅ TSLint passed

Generated by 🚫 dangerJS against 34896ad

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -176,9 +176,11 @@ export class TryCatch implements Integration {
): () => void {
let callback = (fn as any) as WrappedFunction;
try {
callback = callback && (callback.__sentry_wrapped__ || callback);
if (callback && callback.__sentry__) {
original.call(this, eventName, callback.__sentry_original__, options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so we have to call remove event listener twice. Makes sense.

Also I would appreciate a comment on why this is happening.

@kamilogorek kamilogorek merged commit 95edc3c into master Jul 7, 2020
@kamilogorek kamilogorek deleted the remove-all-listeners branch July 7, 2020 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when sentry async load,maybe removeEventListener cannot remove event correctly.
3 participants