diff --git a/dev-packages/e2e-tests/maestro/utils/sentryApi.js b/dev-packages/e2e-tests/maestro/utils/sentryApi.js index 39f10ed298..d5d85b3aa5 100644 --- a/dev-packages/e2e-tests/maestro/utils/sentryApi.js +++ b/dev-packages/e2e-tests/maestro/utils/sentryApi.js @@ -63,7 +63,11 @@ switch (fetch) { } case 'replay': { const event = json(fetchFromSentry(`${baseUrl}/events/${eventId}/json/`)); - const replayId = event._dsc.replay_id.replace(/\-/g, ''); + // Try to get replay_id from contexts first (where SDK puts it), fallback to _dsc + const replayId = (event.contexts?.replay?.replay_id || event._dsc?.replay_id)?.replace(/\-/g, ''); + if (!replayId) { + throw new Error(`No replay_id found in event ${eventId}. Checked contexts.replay.replay_id and _dsc.replay_id`); + } const replay = json(fetchFromSentry(`${baseUrl}/replays/${replayId}/`)); const segment = fetchFromSentry(`${baseUrl}/replays/${replayId}/videos/0/`); diff --git a/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js b/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js index 2a6ac3b14d..18cffce38f 100755 --- a/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js +++ b/dev-packages/e2e-tests/patch-scripts/rn.patch.app.js @@ -27,9 +27,7 @@ Sentry.init({ release: '${SENTRY_RELEASE}', dist: '${SENTRY_DIST}', dsn: 'https://1df17bd4e543fdb31351dee1768bb679@o447951.ingest.sentry.io/5428561', - _experiments: { - replaysOnErrorSampleRate: LaunchArguments.value().replaysOnErrorSampleRate, - }, + replaysOnErrorSampleRate: LaunchArguments.value().replaysOnErrorSampleRate, integrations: [ Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration({