Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/react
SDK Version
6.19.2
Framework Version
3.4.2 (react-native)
Link to Sentry event
https://sentry.io/share/issue/12e378b1436545c0828853d15354b7c7/
Steps to Reproduce
When using the Performance tracking in combination with React Native and the automatic instrumentation defined in https://docs.sentry.io/platforms/react-native/performance/instrumentation/automatic-instrumentation/ for the React Navigation routing, if you have "recursive objects" passed as route parameter, Sentry will badly crashes with "Maximum call stack size exceeded".
(NB: was asked to report in a new issue from #2470 (comment) )
Expected Result
Unfortunately Sentry logic isn't very protective and not preventing infinite loop in objects. an object that have nested inside some reference of a parent will infinitely make dropUndefinedKeys loop https://github.com/getsentry/sentry-javascript/blob/master/packages/utils/src/object.ts#L197
There is nothing "wrong" with the user land code actually it's crashing inside Sentry logic (at least for us) as soon as you pass a recursive object in navigation.
Not exactly sure how to fix this in the utils logic, but one policy could be to have a max depth in the recursion.
Actual Result
it badly crash the app of our users when the performance monitoring is active for them. see attached event.