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

wrong title for every event captured when using Sentry.withScope #4513

Open
aleks-khomenko opened this issue Feb 7, 2025 · 5 comments
Open

Comments

@aleks-khomenko
Copy link

What React Native libraries do you use?

React Native without Frameworks

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.6.0

How does your development environment look like?

System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Pro
Memory: 79.50 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.9.0
path: ~/.asdf/installs/nodejs/20.9.0/bin/node
Yarn: Not Found
npm:
version: 10.1.0
path: ~/.asdf/plugins/nodejs/shims/npm
Watchman:
version: 2024.04.15.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /Users/alekskhomenko/.asdf/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.1
- iOS 18.1
- macOS 15.1
- tvOS 18.1
- visionOS 2.1
- watchOS 11.1
Android SDK: Not Found
IDEs:
Android Studio: 2024.2 AI-242.23726.103.2422.12816248
Xcode:
version: 16.1/16B40
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 3.3.0
path: /Users/alekskhomenko/.asdf/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.8
wanted: 0.73.8
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Sentry.init()

Sentry.init(SentryService.setupConfig());
const App = () => {
return (






);
};

export default Sentry.wrap(App);

Steps to Reproduce

recently I've updated sentry from 5.36.0 to 6.6.0
Now when I review issues in my account, all events get same title Sentry.withScope$argument_0
I didn't change my handler

Image
export const navigationIntegration = Sentry.reactNavigationIntegration();
const setupConfig = (): ReactNativeOptions => ({
  dsn: Config.SENTRY_DSN,
  environment: Config.SENTRY_ENV || 'development',
  debug: false,
  attachStacktrace: true,
  enableAutoSessionTracking: true,
  sessionTrackingIntervalMillis: 10000,
  normalizeDepth: 4,
  tracesSampler: samplingContext => {
    if (samplingContext.name === 'Route Change') {
      // Drop this transaction
      return 0.3;
    } else {
      // Default sample rate
      return 1;
    }
  },
  beforeBreadcrumb: (breadcrumb: Sentry.Breadcrumb) => {
    return breadcrumb.category === 'console' ? null : breadcrumb;
  },
  replaysSessionSampleRate: getReplaySampleRate(),
  replaysOnErrorSampleRate: getReplaySampleRate('onError'),
  integrations: [
    navigationIntegration,
    Sentry.reactNativeTracingIntegration(),
    Sentry.mobileReplayIntegration({
      maskAllText: false,
      maskAllImages: false,
      maskAllVectors: false,
    }),
  ],
});
const captureRuntimeException = ({ error, path }: RuntimeException) => {
  Sentry.withScope(scope => {
    setUserScope(scope);

    scope.setTag('path', path);

    scope.setExtra('error', error);

    if (isFetchBaseQueryError(error) && typeof error.status === 'string') {
      Sentry.captureMessage(`${error.status} ${error.error}`);
    } else if (isBackendError(error)) {
      scope.setLevel('warning');
      Sentry.captureMessage(`${error.data.errorCode} `);
    } else if (isErrorWithMessage(error) && !(error as any)?.stack) {
      Sentry.captureMessage(error.message);
    } else {
      Sentry.captureException(error);
    }
  });
};

Expected Result

Events title should be mapped correctly like in version 5.36.0

Actual Result

Image
@buenaflor
Copy link

thank you, we'll have a look

@Hosam-hsm
Copy link

Any update on this?

@lucas-zimerman
Copy link
Collaborator

@krystofwoldrich could it be related to this? getsentry/sentry#85034

@krystofwoldrich krystofwoldrich self-assigned this Feb 14, 2025
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to In Investigation in Mobile & Cross Platform SDK Feb 14, 2025
@krystofwoldrich
Copy link
Member

krystofwoldrich commented Feb 17, 2025

Hi @Hosam-hsm and @aleks-khomenko,

the title field is generated in Sentry based on the SDK data, the SDK v6 moved where stack trace in the event is saved which caused the server to use it to generate the title.

If you want to see the original captured message, you can use the message field.

@krystofwoldrich
Copy link
Member

We are currently looking into why the title contains the function name instead of the message value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: In Investigation
Development

No branches or pull requests

6 participants