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

Deduplication is happening even after removing Dedupe from integrations #14690

Open
3 tasks done
jacobgmathew opened this issue Dec 12, 2024 · 4 comments
Open
3 tasks done
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK

Comments

@jacobgmathew
Copy link

jacobgmathew commented Dec 12, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8.44.0

Framework Version

Next 14.0.2

Link to Sentry event

No response

Reproduction Example/SDK Setup

sentry.client.config.js:

{
  debug: true
  integrations: (integrations) =>
    integrations.filter((integration) => integration.name != 'Dedupe'),
}

Steps to Reproduce

Call let eventId = Sentry.captureException(error) in window.onerror.

Sentry has already captured the event (in the GlobalHandlers integration?).

Expected Result

A second error should be sent to Sentry since Dedupe integration is removed and the eventId returned should correspond to this event.

Actual Result

Second error is not send and eventId cannot be found on Sentry. Sentry prints out the following debug message:

Sentry Logger [log]: Not capturing exception because it's already been captured.
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 12, 2024
@github-actions github-actions bot added the Package: nextjs Issues related to the Sentry Nextjs SDK label Dec 12, 2024
@lforst
Copy link
Member

lforst commented Dec 13, 2024

Hi, this seems like it is working as intended. The dedupe integration merely dedupes different errors that look the same. Think spamming a faulty button handler. The log message you're seeing is related to the SDK not capturing the same exact error more than once. Think:

const e = new Error()
captureException(e)
captureException(e)

This functionality is always desired and cannot be disabled.

@jacobgmathew
Copy link
Author

The reason I call captureExecption(e) on an error Sentry has already captured is to get an event Id to show the user on an error page so they can reference the error.

If captureExecption(e) is going to ignore multiple calls, is there a way to get the event id of the event generated by the first call to captureExpection(e)?

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 14, 2024
@jacobgmathew
Copy link
Author

I have tried to disable Sentry automatically capturing onerror and onunhandledrejection (which are the errors that I am trying to get the error id for) by removing GlobalHandlers integration, but that does not seem to make a difference. Sentry continues to capture onerror and onunhandledrejection automatically.

@mydea
Copy link
Member

mydea commented Dec 16, 2024

How did you remove the GlobalHandlers integration? What debug: true logs do you get when you do that?

Generally speaking, you can try to use Sentry.lastEventId() to get the ID of the last sent error event. This may or may not be the specific error you are looking at, though. But this would be the recommended way to solve this, as of now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK
Projects
Status: No status
Development

No branches or pull requests

3 participants