getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.58k stars 337 forks source link

Recursion Limit Hit #713

Closed lisabaut closed 4 years ago

lisabaut commented 5 years ago

OS:

Platform:

SDK:

react-native version: 0.61.2

Init Code:

import * as Sentry from '@sentry/react-native';

Sentry.init({
  dsn: 'https://...@sentry.io/...',
  debug: true
});

I have the following issue:

When passing a deep nested object with scope.setExtras to the local scope like:

 Sentry.withScope(scope => {
    scope.setTag('my tag', 'my value');
    scope.setExtras(deepNestedObject); // <-- !
    Sentry.captureMessage('my error message);
});

the object's data structure is displayed nicely within the report details view in the Sentry UI below the "Additional Data" section.

Unfortunately it stops showing further key-value pairs below the third nested object level. Instead each value is displayed with <recursion limit hit>.

Within the docs for react native SDK I was not able to find a possibility to increase the display depth for nested objects.

This issue does not provide a solution unfortunately.

This issue with a similar topic refers to the Javascript SDK and points to the Sentry JavaScript docs.

But Sentry.Integrations.ExtraErrorData does not exist in the @sentry/react-native package

and this code does not work for me in react-native:

import * as Sentry from '@sentry/react-native';
import * as Integrations from '@sentry/integrations';

Sentry.init({
  dsn: 'https://...@sentry.io/...',
  integrations: [new Integrations.ExtraErrorData({ depth: 10 })],
  debug: true
});

Question:

How can I increase the depth level in @sentry/react-native for displaying deep nested objects in the "Additional Data" section? Thanks.

whatwg6 commented 5 years ago

same issue

vasilich6107 commented 4 years ago

Any news?

lobsterkatie commented 4 years ago

The <recursion limit hit> comes from the Java SDK (which underlies this SDK's Android reporting) and is unfortunately not currently configurable. There's an issue tracking that question here.

alew97 commented 3 years ago

I saw @lobsterkatie 's response on https://github.com/getsentry/sentry-java/issues/543 about RN sentry no longer relying on the Java SDK which defines the max nesting level of 3. However I still don't know how to increase this limit, what if i want a nesting level of 10? As @lisabaut pointed out in the original post, the ExtraErrorData integration does not work in React Native.

any tips from anyone?

lobsterkatie commented 3 years ago

@jennmueng You're the most up on the current RN SDK. Do you know which of the wrapped SDKs sets the max depth? If not I can dig into it.

jennmueng commented 3 years ago

@lobsterkatie @alew97 It's set on JS, now Android and Cocoa shouldn't touch the nesting depth anymore if I recall correctly. So if you just set normalizeDepth it should be good.