Skip to content

React native SDK adding duplicated breadcrumbs for apollo/client requests #5432

@rodolfoBee

Description

@rodolfoBee

What React Native libraries do you use?

Expo (mobile only)

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

7.7.0

How does your development environment look like?

package.json:

{
  "name": "repro",
  "version": "1.0.0",
  "private": true,
  "main": "index.tsx",
  "scripts": {
    "ios": "APP_VARIANT=development expo run:ios -d"
  },
  "dependencies": {
    "@apollo/client": "^4.0.9",
    "@expo/metro-config": "^54.0.5",
    "@sentry/core": "10.27.0",
    "@sentry/react-native": "^7.7.0",
    "expo": "~54.0.10",
    "metro-cache": "0.83.1",
    "metro-config": "0.83.1",
    "react": "19.1.0",
    "react-native": "0.81.4",
  }
}

Sentry.init()

Sentry.init({
dsn: INSERT_SENTRY_DSN_HERE,
enabled: true,
debug: true,
enableAutoSessionTracking: true,
normalizeDepth: 5,
normalizeMaxBreadth: 100,
attachStacktrace: true,
attachScreenshot: true,
integrations: [
Sentry.reactNativeTracingIntegration({
finalTimeoutMs: 5000,
}),
],
beforeSend(event, hint) {
return event
},
})

Steps to Reproduce

  1. Run the app in from the gist in the internal ticket (it contains a customer's domain)
  2. Send the request via Apollo library to add breadcrumbs
  3. Send a test event

Expected Result

The SDK creates only one breadcrumb for the apollo client request.

Actual Result

The event has multiple breadcrumb entries for the same request (HTTP, Fetch and XHR). This can lead to issues such as:

  • reach breadcrumb limit leading to breadcrumbs being lost.
  • reaching event size limit.
Image Image

Links to events are available in the internal ticket.

The current workaround is to disable some of the breadcrumb options or to add filter with beforeBreadcrumb.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions