Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3285,7 +3285,7 @@ PODS:
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- RNSentry (8.27.0):
- RNSentry (8.32.0):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand Down Expand Up @@ -4182,7 +4182,7 @@ SPEC CHECKSUMS:
RNReactNativeHapticFeedback: 6c8677db48f62a635e6a2065f5d2bd02498d7a73
RNReanimated: e75c988a6527ec651ea2957b93891ddb64d530d4
RNScreens: 433b8c24dd1dfeaa3b61f72d55052cb64fd19c5f
RNSentry: 3dcc26572ed12d8ee7edbe80d198dda70ac10d4c
RNSentry: b182c4e68ff5e50275011476ea2702f05412ae05
RNShare: eb378c57de30a83b0253eed74762ee99249f47d7
RNSVG: 394cfd0518613b144c65ffe69045f827b78a7a7c
RNWorklets: 3da8f468c848547646f4e6b12fb46ad93a2cdee2
Expand Down
324 changes: 188 additions & 136 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@
"@react-ng/bounds-observer": "^0.2.1",
"@rnmapbox/maps": "10.3.2",
"@sbaiahmed1/react-native-biometrics": "0.15.0",
"@sentry/core": "10.75.0",
"@sentry/react-native": "8.27.0",
"@sentry/core": "10.76.2",
"@sentry/react-native": "8.32.0",
"@shopify/flash-list": "2.3.2",
"@shopify/react-native-skia": "^2.11.2",
"@ua/react-native-airship": "26.7.0",
Expand Down Expand Up @@ -277,7 +277,7 @@
"@rsdoctor/rspack-plugin": "^1.5.17",
"@rspack/core": "^2.1.2",
"@rspack/plugin-react-refresh": "^2.0.2",
"@sentry/browser-utils": "10.75.0",
"@sentry/browser-utils": "10.76.2",
"@sentry/cli": "3.3.0",
"@sentry/webpack-plugin": "5.2.0",
"@storybook/addon-a11y": "10.6.2",
Expand Down
2 changes: 1 addition & 1 deletion patches/sentry-browser-utils/details.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `@sentry/browser-utils` patches

### [@sentry+browser-utils+10.75.0+001+data-sentry-label.patch](@sentry+browser-utils+10.75.0+001+data-sentry-label.patch)
### [@sentry+browser-utils+10.76.2+001+data-sentry-label.patch](@sentry+browser-utils+10.76.2+001+data-sentry-label.patch)

- Reason: Enhances the `htmlTreeAsString` function to support `data-sentry-label` attributes for better element identification in Sentry spans. The patch:
- Always includes `data-sentry-label` in the list of checked attributes for each DOM element
Expand Down
2 changes: 1 addition & 1 deletion patches/sentry-browser/details.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `@sentry/browser` patches

### [@sentry+browser+10.75.0.patch](@sentry+browser+10.75.0.patch)
### [@sentry+browser+10.76.2.patch](@sentry+browser+10.76.2.patch)

Reason: improve developer experience by adding `request-id` to spans related to API calls. This takes request-id from response headers and write it to the span related to that response. With that information it is easier to connect backend request / logs with data retrieved from Sentry.
- Upstream PR/issue: N/A
Expand Down
2 changes: 1 addition & 1 deletion patches/sentry-core/details.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `@sentry/core` patches

### [@sentry+core+10.75.0+001+initial.patch](@sentry+core+10.75.0+001+initial.patch)
### [@sentry+core+10.76.2+001+initial.patch](@sentry+core+10.76.2+001+initial.patch)

- Reason: Adds `request-id` from fetch response headers to spans, making it easier to correlate Sentry data with backend logs.
- Upstream PR/issue: N/A
Expand Down
2 changes: 1 addition & 1 deletion patches/sentry-react-native/details.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `@sentry/react-native` patches

### [@sentry+react-native+8.27.0.patch](@sentry+react-native+8.27.0.patch)
### [@sentry+react-native+8.32.0.patch](@sentry+react-native+8.32.0.patch)

- Reason: Fixes React Native path resolution in the Sentry Ruby script during iOS builds. The original implementation failed to locate `react-native/package.json` in our hybrid app setup. The patch changes the resolution strategy to first try resolving from the installation root (similar to react-native-svg and react-native-reanimated), and falls back to ENV variables with support for both node_modules conventions.
- Upstream PR/issue: N/A (specific to our hybrid app environment)
Expand Down
23 changes: 5 additions & 18 deletions src/setup/telemetry/setupSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ function setupSentry(): void {
tracesSampleRate: 1.0,
enableAutoPerformanceTracing: true,
enableUserInteractionTracing: true,
// TurboModuleContext adds CPU cost to every RNSentry call on iOS, see https://github.com/Expensify/App/pull/103900
integrations: (defaultIntegrations) => {
// Read from the SDK, so the filter keeps working if Sentry renames the integration. Looked up here rather
// than at module load so importing this file does not call into the SDK.
const turboModuleContextIntegrationName = Sentry.turboModuleContextIntegration().name;
return [...defaultIntegrations.filter((integration) => integration.name !== turboModuleContextIntegrationName), ...integrations];
},
integrations,
environment: CONFIG.ENVIRONMENT,
release: `${pkg.name}@${semanticVersion}`,
dist: buildNumber,
Expand Down Expand Up @@ -94,17 +88,10 @@ function setupSentry(): void {
// Native SDK is initialized early in Application.onCreate (Android) and AppDelegate (iOS)
// via SentryNativeSDKManager so native code can report to Sentry before JS loads.
autoInitializeNativeSdk: false,
// We set experimental lifecycle value to enable profiling for whole spans. Without this option profile often is dropped early and we haven't the whole picture
// See https://github.com/Expensify/App/issues/87489
// eslint-disable-next-line @typescript-eslint/naming-convention
_experiments: {
profilingOptions: {
// When updating the profile sample rate, make sure it will not blow up our current limit in Sentry.
// This option replaces `profilesSampleRate`
profileSessionSampleRate: 0.5,
lifecycle: 'trace',
},
},
// Do not set `_experiments.profilingOptions` here on its own. The native SDK is started by SentryNativeSDKManager
// without profiling options, so session sampling is never configured, and the UI profiling integration the SDK
// adds for these options would start the iOS continuous profiler whenever a root span starts. Enabling UI
// profiling needs the same options in the native init as well.
});

Sentry.setTag(CONST.TELEMETRY.TAGS.BUILD_TYPE, CONFIG.IS_HYBRID_APP ? CONST.TELEMETRY.BUILD_TYPE_HYBRID_APP : CONST.TELEMETRY.BUILD_TYPE_STANDALONE);
Expand Down
18 changes: 3 additions & 15 deletions tests/unit/setupSentryIntegrationOrderTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ jest.mock('@libs/telemetry/integrations', () => ({
jest.mock('@sentry/react-native', () => ({
init: jest.fn(),
setTag: jest.fn(),
turboModuleContextIntegration: () => ({name: 'TurboModuleContext'}),
}));

const sentryMock = jest.requireMock<{init: jest.Mock<void, [{integrations: (defaultIntegrations: Integration[]) => Integration[]}]>; setTag: jest.Mock}>('@sentry/react-native');
const sentryMock = jest.requireMock<{init: jest.Mock<void, [{integrations: Integration[]}]>; setTag: jest.Mock}>('@sentry/react-native');

function initIntegrationNames(defaultIntegrations: Integration[] = []): string[] {
function initIntegrationNames(): string[] {
setupSentry();
const integrations = sentryMock.init.mock.calls.at(0)?.at(0)?.integrations;
return (integrations?.(defaultIntegrations) ?? []).map((integration) => integration.name);
return (sentryMock.init.mock.calls.at(0)?.at(0)?.integrations ?? []).map((integration) => integration.name);
}

describe('setupSentry integration order', () => {
Expand All @@ -52,14 +50,4 @@ describe('setupSentry integration order', () => {
it('drops the integrations that are stubbed out on the current platform', () => {
expect(initIntegrationNames()).not.toContain(undefined);
});

it('drops the default TurboModuleContext integration and keeps the other defaults', () => {
// Given the SDK defaults include TurboModuleContext
// When setupSentry builds its integration list
const names = initIntegrationNames([{name: 'TurboModuleContext'}, {name: 'NativeFrames'}]);

// Then TurboModuleContext is gone and the other defaults stay
expect(names).not.toContain('TurboModuleContext');
expect(names).toContain('NativeFrames');
});
});
Loading