diff --git a/CHANGELOG.md b/CHANGELOG.md index 6418b28f9a..98d153d9c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Features - Enable "Open Sentry" button in Playground for Expo apps ([#5947](https://github.com/getsentry/sentry-react-native/pull/5947)) +- Add `attachAllThreads` option to attach full stack traces for all threads to captured events on iOS ([#5960](https://github.com/getsentry/sentry-react-native/issues/5960)) ### Dependencies diff --git a/packages/core/src/js/options.ts b/packages/core/src/js/options.ts index 61df5a3242..abe769069b 100644 --- a/packages/core/src/js/options.ts +++ b/packages/core/src/js/options.ts @@ -96,6 +96,14 @@ export interface BaseReactNativeOptions { */ attachThreads?: boolean; + /** + * When enabled, full stack traces for all threads are attached to all captured events. + * + * @default false + * @platform ios + */ + attachAllThreads?: boolean; + /** * When enabled, certain personally identifiable information (PII) is added by active integrations. * diff --git a/packages/core/test/wrapper.test.ts b/packages/core/test/wrapper.test.ts index 5762929a4e..0a546bb17b 100644 --- a/packages/core/test/wrapper.test.ts +++ b/packages/core/test/wrapper.test.ts @@ -224,6 +224,23 @@ describe('Tests Native Wrapper', () => { expect(NATIVE.enableNative).toBe(true); }); + test('passes attachAllThreads to native SDK', async () => { + await NATIVE.initNativeSdk({ + dsn: 'test', + enableNative: true, + autoInitializeNativeSdk: true, + attachAllThreads: true, + devServerUrl: undefined, + defaultSidecarUrl: undefined, + mobileReplayOptions: undefined, + }); + + expect(RNSentry.initNativeSdk).toHaveBeenCalled(); + // @ts-expect-error mock value + const initParameter = RNSentry.initNativeSdk.mock.calls[0][0]; + expect(initParameter).toHaveProperty('attachAllThreads', true); + }); + test('filter integrations when initializing Native SDK', async () => { await NATIVE.initNativeSdk({ dsn: 'test',