Skip to content

thirdPartyErrorFilterIntegration mis-categorizing native frames in stacktrace #17674

Closed

Description

@md384

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/react

SDK Version

10.11.0

Framework Version

React 18.2.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

Using thirdPartyErrorFilterIntegration with the apply-tag-if-contains-third-party-frames behaviour

captureConsoleIntegration({ levels: ['error'] }),
thirdPartyErrorFilterIntegration({
  filterKeys: ['some-key'],
  behaviour: 'apply-tag-if-contains-third-party-frames',
}),

Steps to Reproduce

The following example

  Promise.allSettled([
    Promise.resolve(33),
    new Promise((resolve) => setTimeout(() => resolve(66), 0)),
    99,
    Promise.reject(new Error('an error')),
  ]).then((values) => values.forEach((value) => console.error(value)))

creates a stacktrace with a frame

{
  "function": "Array.forEach",
  "filename": "<anonymous>",
  "abs_path": "<anonymous>",
  "in_app": true,
  "data": {
    "client_in_app": true
  }
}

This frame appears to cause the error as tagged with third_party_code as true. This is the only frame in the stacktrace not from our bundle - thirdPartyErrorFilterIntegration appears to be working for us correctly elsewhere i.e. stacktraces without frames from native code.

I have seen similar mis-categorizations with Promise.all and Promise.allSettled so I believe it is any native frame.

Expected Result

Frames for native code that do not cause an error should not set the third_party_code tag.

Actual Result

third_party_code is true

Additional Context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 16, 2025
  2. changed the title [-]thirdPartyErrorFilterIntegration mis-categorizing if Promise frames in stacktrace[/-] [+]thirdPartyErrorFilterIntegration mis-categorizing native frames in stacktrace[/+] on Sep 16, 2025
  3. Lms24 commented on Sep 17, 2025

    @Lms24
    Member

    Hey, thanks for reporting! We need to think a bit about how to solve this since it's probably not easy impossible to distinguish such native frames from within your code from native frames in 3rd party code. My idea for now would be to always ignore "filename": "<anonymous>" frames but I still want to think a bit about this a bit.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 17, 2025
  5. self-assigned this
    on Sep 17, 2025
  6. md384 commented on Sep 17, 2025

    @md384
    Author

    @Lms24 here are some more example I found

    {
      "function": "async Promise.allSettled",
      "filename": "index 0",
      "abs_path": "index 0",
      "in_app": true,
      "data": {
        "client_in_app": true
      }
    }

    and

    {
      "function": "async Promise.all",
      "filename": "index 1",
      "abs_path": "index 1",
      "in_app": true,
      "data": {
        "client_in_app": true
      }
    }

    So "filename": "<anonymous>" will not work for these. However for each case I've seen and only for native frames, there are no lineno or colno attributes so perhaps you can ignore any frame without a lineno and colno

  7. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 17, 2025
  8. Lms24 commented on Sep 18, 2025

    @Lms24
    Member

    Thanks for the suggestion! I decided to go with requiring at least one of lineno and colno properties: #17693

  9. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 18, 2025
  10. github-actions commented on Sep 22, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #17693, which was included in the 10.13.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions