Skip to content

Commit 6cc2aa7

Browse files
antonisclaude
andauthored
feat(ios): Add attachAllThreads option (#5960)
* feat(ios): Add `attachAllThreads` option Expose the Cocoa SDK's `attachAllThreads` option so it can be configured from JS via `Sentry.init()`. When enabled, full stack traces for all threads are attached to captured events on iOS. Closes #5959 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update changelog --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cac4a4f commit 6cc2aa7

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Features
1212

1313
- Enable "Open Sentry" button in Playground for Expo apps ([#5947](https://github.com/getsentry/sentry-react-native/pull/5947))
14+
- 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))
1415

1516
### Fixes
1617

packages/core/src/js/options.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ export interface BaseReactNativeOptions {
9696
*/
9797
attachThreads?: boolean;
9898

99+
/**
100+
* When enabled, full stack traces for all threads are attached to all captured events.
101+
*
102+
* @default false
103+
* @platform ios
104+
*/
105+
attachAllThreads?: boolean;
106+
99107
/**
100108
* When enabled, certain personally identifiable information (PII) is added by active integrations.
101109
*

packages/core/test/wrapper.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,23 @@ describe('Tests Native Wrapper', () => {
224224
expect(NATIVE.enableNative).toBe(true);
225225
});
226226

227+
test('passes attachAllThreads to native SDK', async () => {
228+
await NATIVE.initNativeSdk({
229+
dsn: 'test',
230+
enableNative: true,
231+
autoInitializeNativeSdk: true,
232+
attachAllThreads: true,
233+
devServerUrl: undefined,
234+
defaultSidecarUrl: undefined,
235+
mobileReplayOptions: undefined,
236+
});
237+
238+
expect(RNSentry.initNativeSdk).toHaveBeenCalled();
239+
// @ts-expect-error mock value
240+
const initParameter = RNSentry.initNativeSdk.mock.calls[0][0];
241+
expect(initParameter).toHaveProperty('attachAllThreads', true);
242+
});
243+
227244
test('filter integrations when initializing Native SDK', async () => {
228245
await NATIVE.initNativeSdk({
229246
dsn: 'test',

0 commit comments

Comments
 (0)