-
-
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
Angular - errors are reported multiple times #2744
Comments
I'm currently working on @sentry/angular specific package. I'll make sure to take this into account, thanks! |
Great! Thank you. Looking forward to new package. |
Sounds great! Let us know when we can be of any help :) |
Looking forward to this, would love for these |
Any update on this? It's been over six months |
I still get multiple events with @sentry/angular |
We want to get to the bottom of this and we need a bit of your help. We need a reproduction of an app where this is happening. Please, submit one and we will look into it. |
I am able to reproduce this issue with a bare bones Angular setup: https://github.com/pfei5/sentry-duplicate-events.git As soon as I provide the Sentry errorHandler, duplicate events are reported for HttpErrorResponses. The workaround proposed here works, but it took me hours to figure this out. It is documented nowhere, as far as I can tell, and this issue has been out in the wild for years. Decluttering Sentry would be a good place to document this sort of behaviour, IMHO. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This is, IMHO, a serious issue and should not be closed @github-actions. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
As far as I can tell this issue is as hot as ever. Do not close @github-actions. |
@vladanpaunovic or someone else could you please stop this issue from automatically being closed. As far as I can tell it has not been fixed. Also I did provide a setup to reproduce this issue: #2744 (comment) |
Any updates on this ? |
@HazAT is it possible to update the labels for this issue? Like removing the label |
Hi folks, sorry for letting this slip through our radar! I recently looked at #5417 which is a slightly different report but I believe the root cause is the same in both issues: The I wrote up a workaround in the issue, which basically boils down to disabeling the I'm not entirely against excluding it though, so feel free to leave some thoughts what you'd prefer. Does this solve the issue for you all? |
Thank you for the quick response! The workaround fixed my problem. |
I'll close this issue for the time being, as the workaround seems to fix the problem. Feel free to tag me if you think it should be repoened. |
@Lms24 Does this mean the issue won't be fixed? |
@Lms24 I think this issue needs to be reopened. Yes there is currently a workaround but the initial issue is still not fixed until now. I don't see an other issue which will remind the Sentry team to fix this as they are all closed. |
Hi, sorry for taking so long. We're going to disable |
Package + Version
@sentry/browser
@sentry/integrations
Version:
Description
I'm having an issue with errors being reported multiple times. One error is correctly catched via angular ErrorHandler, second one is catched by
captureException
executed insidesentryWrapped
function.I tried proposed solution for angular, shown below:
but it didn't help. To block additional error reports I had to set:
It's just a workaround that I'd rather not use, since errors may also occur outside angular.
I started debugging which
setTimeout
was the root cause of duplicated reports. I found that it's caused byhostReportError
from rxjs ( https://github.com/ReactiveX/rxjs/blob/f5278aa89ea164caf5cf10e77d7bd00eff26fc0f/src/internal/util/hostReportError.ts#L6 )Starting from rxjs v6.0.0 they changed the way of reporting the errors from sync to async mode.
As a part from investigation I tried to switch back to sync error reporting (using rxjs
config.useDeprecatedSynchronousErrorHandling = true
).After this change, to stop duplicated error reports I had to set TryCatch options to
eventTarget: false
(setTimeout: false
was no more needed).Seems that Sentry is wrapping
addEventListener
for angular http client https://github.com/angular/angular/blob/master/packages/common/http/src/xhr.ts#L311. SettingXMLHttpRequest: false
doesn't work.As a temporary fix I'll probably check error report in
beforeSend
and skip unwanted ones, but could you fix it internally? Thanks :)Related issues
#2533
#2532
#2169
The text was updated successfully, but these errors were encountered: