sentry-capacitor icon indicating copy to clipboard operation
sentry-capacitor copied to clipboard

Duplicate Breadcrumbs on Android

Open fr3fou opened this issue 3 years ago • 0 comments

Environment

    "@sentry/capacitor": "0.9.0",
    "@sentry/react": "7.8.1",
    "@sentry/tracing": "7.8.1",

Sentry SaaS

Haven't upgraded to 0.10.x, as we're still running Capacitor 3.

Steps to Reproduce

  1. Use a Capacitor app on an Android device and cause an exception
  2. Open the Sentry dashboard image

Expected Result

Breadcrumbs shouldn't be duplicated.

Actual Result

The breadcrumbs are duplicated.

My integration in the JS side is nothing special:

Sentry.init(
  {
    dsn: SENTRY_DSN,
    integrations: [new BrowserTracing()],
    release: `app-v1@${VERSION?.trim() ?? gitInfo.commit.shortHash}`,
    dist: gitInfo.commit.shortHash,
    debug: false,
    beforeBreadcrumb(breadcrumb, hint) {
      if (breadcrumb.category === "xhr") {
        const response = hint?.xhr.response ?? {}
        const request = hint?.input ?? {}
        breadcrumb.data = {
          ...breadcrumb.data,
          request,
          response,
        }
      }
      return breadcrumb
    },
  },
  SentryReact.init
)

fr3fou avatar Oct 10 '22 08:10 fr3fou