File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,12 @@ switch (fetch) {
6363 }
6464 case 'replay' : {
6565 const event = json ( fetchFromSentry ( `${ baseUrl } /events/${ eventId } /json/` ) ) ;
66- const replayId = event . _dsc . replay_id . replace ( / \- / g, '' ) ;
66+ const replayIdRaw = event . _dsc ?. replay_id ;
67+ if ( ! replayIdRaw ) {
68+ console . error ( 'Event DSC:' , JSON . stringify ( event . _dsc , null , 2 ) ) ;
69+ throw new Error ( `Event ${ eventId } does not have a replay_id in DSC. Replay might not be configured properly. Check that replaysOnErrorSampleRate or replaysSessionSampleRate is set.` ) ;
70+ }
71+ const replayId = replayIdRaw . replace ( / \- / g, '' ) ;
6772 const replay = json ( fetchFromSentry ( `${ baseUrl } /replays/${ replayId } /` ) ) ;
6873 const segment = fetchFromSentry ( `${ baseUrl } /replays/${ replayId } /videos/0/` ) ;
6974
Original file line number Diff line number Diff line change @@ -23,20 +23,23 @@ import * as Sentry from '@sentry/react-native';
2323import { EndToEndTestsScreen } from 'sentry-react-native-e2e-tests';
2424import { LaunchArguments } from "react-native-launch-arguments";
2525
26+ const launchArgs = LaunchArguments.value();
27+
2628Sentry.init({
2729 release: '${ SENTRY_RELEASE } ',
2830 dist: '${ SENTRY_DIST } ',
2931 dsn: 'https://1df17bd4e543fdb31351dee1768bb679@o447951.ingest.sentry.io/5428561',
30- _experiments: {
31- replaysOnErrorSampleRate: LaunchArguments.value().replaysOnErrorSampleRate,
32- },
32+ replaysOnErrorSampleRate: launchArgs.replaysOnErrorSampleRate,
33+ replaysSessionSampleRate: launchArgs.replaysSessionSampleRate,
3334 integrations: [
3435 Sentry.mobileReplayIntegration(),
3536 Sentry.feedbackIntegration({
3637 enableTakeScreenshot: true,
3738 }),
3839 ],
3940});
41+
42+ console.log('[E2E] Initialized with replaysOnErrorSampleRate:', launchArgs.replaysOnErrorSampleRate);
4043` ;
4144const e2eComponentPatch = '<EndToEndTestsScreen />' ;
4245const lastImportRex = / ^ ( [ ^ ] * ) ( i m p o r t \s + [ ^ ; ] * ?; $ ) / m;
You can’t perform that action at this time.
0 commit comments