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

Upgrading `@sentry/react` from `7.99.0` to `7.100.1` breaks `setUser` with `:` adding `}`

Open ihmpavel opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

7.100.1

Framework Version

18.2.0

Link to Sentry event

No response

SDK Setup

Sentry.init({
    dsn: 'xxx',
    integrations: [
      Sentry.reactRouterV6BrowserTracingIntegration({
        useEffect,
        useLocation,
        useNavigationType,
        createRoutesFromChildren,
        matchRoutes,
      }),
      Sentry.replayIntegration(),
    ],
    tracesSampleRate: 0.33,
    release: `${name}@${version}`,
    replaysSessionSampleRate: 0.33,
    replaysOnErrorSampleRate: 1.0,
    normalizeDepth: 6,
  })

Steps to Reproduce

  1. Init Sentry
  2. After user login, call Sentry.setUser({ id: 'Manager:123' })
  3. Expected to see user Manager:123 in administration
  4. From browser is sent Manager}:123 (checked network; our code is setting Manager:123)
  5. In Sentry dashboard is Manager}:123 for events with `@sentry/react

Expected Result

Before version 7.99.0 everything worked as expected. In version 7.100.1 https://github.com/getsentry/sentry-javascript/compare/7.99.0...7.100.1 something happened to @sentry/react and started adding } to user.id while calling Sentry.setUser({ id: 'Manager:123' })

Actual Result

Version 7.100.1 should set in code Sentry.setUser({ id: 'Manager:123' }) and in UI the user.id should be Manager:123 instead of Manager}:123

ihmpavel avatar Feb 11 '24 17:02 ihmpavel

Hi, I wasn't able to reproduce the faulty behavior you're describing from the reproduction steps you provided. Both the sent event payloads look good, and also inside Sentry, everything looks as expected. Would you mind sharing a repo or stackblitz or similar that reproduces this behaviour? Thanks!

lforst avatar Feb 12 '24 08:02 lforst

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 remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Mar 22 '24 07:03 getsantry[bot]