Skip to content

Commit a0e4630

Browse files
authored
Merge pull request #25 from thinkocapo/success-tracing
Success tracing
2 parents 33a0293 + c130661 commit a0e4630

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

github_release.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# If you have an env file, and you've set SE variable to something
2+
# other than tda, prevent the release from happening
3+
if [ -f ".env" ]
4+
then
5+
export $(cat .env | xargs) # Set env vars from .env file so they're accessible
6+
if [[ $SE && $SE != 'tda' ]]
7+
then
8+
printf "Your SE environment variable is set to $SE.\nThe SE variable must be set to tda to create a release.\nPlease change it in your env file and try again."
9+
exit
10+
fi
11+
fi
12+
113
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
214
REPO=sentry-demos/sentry_react_native
315

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Toast from 'react-native-toast-message';
2323
import {store} from './reduxApp';
2424
import {DSN} from './config';
2525
import {SE} from '@env'; // SE is undefined if no .env file is set
26+
console.log("> SE", SE)
2627

2728
const reactNavigationV5Instrumentation = new Sentry.ReactNavigationV5Instrumentation(
2829
{

src/screens/CartScreen.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ const CartScreen = ({navigation}) => {
124124
return response;
125125
};
126126

127+
React.useEffect(() => {
128+
fetch(`${BACKEND_URL}/success`) // exists just to add span data to demo
129+
}, []);
130+
127131
return (
128132
<View style={styles.screen}>
129133
<View style={styles.titleContainer}>

src/screens/CheckoutScreen.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import Toast from 'react-native-toast-message';
1515
import {AppDispatch, RootState} from '../reduxApp';
1616
import {GradientBtn} from './CartScreen';
1717
import {BACKEND_URL} from '../config';
18-
// import {API_URL} from 'react-native-dotenv'
1918

2019
export type UIToast = typeof Toast;
2120

@@ -158,6 +157,10 @@ const CheckoutScreen = (props) => {
158157
)
159158
}
160159

160+
React.useEffect(() => {
161+
fetch(`${BACKEND_URL}/success`) // exists just to add span data to demo
162+
}, []);
163+
161164
return (
162165
<View style={styles.screen}>
163166
<Text

src/screens/EmpowerPlant.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ const EmpowerPlant = ({navigation}) => {
7474
}, [navigation]);
7575

7676
React.useEffect(() => {
77-
fetch(`${BACKEND_URL}/success`) // exists just to add span data to demo
7877
loadData(); // this line is not blocking
7978
}, []);
8079

@@ -176,9 +175,7 @@ const ProductItem = (props: {
176175
imgcropped: string;
177176
appDispatch: AppDispatch;
178177
}): React.ReactElement => {
179-
React.useEffect(() => {
180-
fetch(`${BACKEND_URL}/success`) // exists just to add span data to demo
181-
}, []);
178+
182179
return (
183180
<View style={styles.statisticContainer}>
184181
<View style={styles.card}>{selectImage(props.imgcropped)}</View>

src/screens/HomeScreen.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ import {
99
View,
1010
} from 'react-native';
1111
import {StackNavigationProp} from '@react-navigation/stack';
12-
import {
13-
CommonActions,
14-
useNavigation,
15-
useNavigationState,
16-
} from '@react-navigation/native';
12+
import { CommonActions } from '@react-navigation/native';
1713

1814
import * as Sentry from '@sentry/react-native';
1915

2016
const globalAny:any = global;
2117

2218
import {getTestProps} from '../../utils/getTestProps';
23-
import {DSN} from '../config';
19+
import {DSN, BACKEND_URL} from '../config';
2420

2521
interface Props {
2622
navigation: StackNavigationProp<any, 'HomeScreen'>;
@@ -34,7 +30,8 @@ const HomeScreen = (props: Props) => {
3430

3531
const setScopeProps = () => {
3632
const dateString = new Date().toString();
37-
33+
34+
// user info was already set in App.tsx
3835
Sentry.setUser({
3936
id: 'test-id-0',
4037
@@ -111,6 +108,10 @@ const HomeScreen = (props: Props) => {
111108
console.log('Test scope properties were set.');
112109
};
113110

111+
React.useEffect(() => {
112+
fetch(`${BACKEND_URL}/success`)
113+
}, []);
114+
114115
return (
115116
<>
116117
<StatusBar barStyle="dark-content" />

0 commit comments

Comments
 (0)