From ab5023662ae96070997e77cbb94364a98c64f3cf Mon Sep 17 00:00:00 2001 From: Cristiano Tofani Date: Thu, 20 Feb 2025 16:49:39 +0100 Subject: [PATCH 1/3] refactor:[IOPLT-978] Changes the Sentry integration for performance monitoring --- ts/App.tsx | 15 +++++++++------ ts/RootContainer.tsx | 12 ++++++------ ts/navigation/AppStackNavigator.tsx | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ts/App.tsx b/ts/App.tsx index 7b4b932840f..47fa3f6c246 100644 --- a/ts/App.tsx +++ b/ts/App.tsx @@ -21,9 +21,9 @@ export type ReactNavigationInstrumentation = ReturnType< typeof Sentry.reactNavigationIntegration >; -export const navigationIntegration = Sentry.reactNavigationIntegration({ - enableTimeToInitialDisplay: true -}); +// export const navigationIntegration = Sentry.reactNavigationIntegration({ +// enableTimeToInitialDisplay: true +// }); const removeUserFromEvent = ( event: T @@ -48,11 +48,14 @@ Sentry.init({ return removeUserFromEvent(event); }, ignoreErrors: ["HTTPClientError"], - integrations: integrations => [...integrations, navigationIntegration], + integrations: integrations => [ + ...integrations, + Sentry.reactNativeTracingIntegration() + ], enabled: !isDevEnv, // https://sentry.zendesk.com/hc/en-us/articles/23337524872987-Why-is-the-the-message-in-my-error-being-truncated maxValueLength: 3000, - tracesSampleRate: 0.3, + tracesSampleRate: 0.2, sampleRate: 0.3 }); @@ -76,7 +79,7 @@ const App = (): JSX.Element => ( diff --git a/ts/RootContainer.tsx b/ts/RootContainer.tsx index dcab724a737..15140d03a0b 100644 --- a/ts/RootContainer.tsx +++ b/ts/RootContainer.tsx @@ -28,13 +28,13 @@ import { } from "./store/reducers/persistedPreferences"; import { GlobalState } from "./store/reducers/types"; import customVariables from "./theme/variables"; -import { ReactNavigationInstrumentation } from "./App"; +// import { ReactNavigationInstrumentation } from "./App"; import { setScreenReaderEnabled } from "./store/actions/preferences"; -type Props = ReturnType & - typeof mapDispatchToProps & { - routingInstumentation: ReactNavigationInstrumentation; - }; +type Props = ReturnType & typeof mapDispatchToProps; +// & { +// routingInstumentation: ReactNavigationInstrumentation; +// }; /** * The main container of the application with: @@ -119,7 +119,7 @@ class RootContainer extends PureComponent { /> {/* When debug mode is enabled, the following information diff --git a/ts/navigation/AppStackNavigator.tsx b/ts/navigation/AppStackNavigator.tsx index 330463a8ec1..d8347a9ab1a 100644 --- a/ts/navigation/AppStackNavigator.tsx +++ b/ts/navigation/AppStackNavigator.tsx @@ -177,7 +177,7 @@ const InnerNavigationContainer = (props: InnerNavigationContainerProps) => { export const IONavigationContainer = ({ routingInstrumentation }: { - routingInstrumentation: ReactNavigationInstrumentation; + routingInstrumentation?: ReactNavigationInstrumentation; }) => ( From 0de782ee13ae5079c2e670911dc23ceef1a60320 Mon Sep 17 00:00:00 2001 From: Cristiano Tofani Date: Thu, 20 Feb 2025 17:17:57 +0100 Subject: [PATCH 2/3] removes commented out code --- ts/App.tsx | 4 ---- ts/RootContainer.tsx | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ts/App.tsx b/ts/App.tsx index 47fa3f6c246..0e791daede1 100644 --- a/ts/App.tsx +++ b/ts/App.tsx @@ -21,10 +21,6 @@ export type ReactNavigationInstrumentation = ReturnType< typeof Sentry.reactNavigationIntegration >; -// export const navigationIntegration = Sentry.reactNavigationIntegration({ -// enableTimeToInitialDisplay: true -// }); - const removeUserFromEvent = ( event: T ): T => { diff --git a/ts/RootContainer.tsx b/ts/RootContainer.tsx index 15140d03a0b..719d5f02d10 100644 --- a/ts/RootContainer.tsx +++ b/ts/RootContainer.tsx @@ -118,9 +118,7 @@ class RootContainer extends PureComponent { backgroundColor={customVariables.androidStatusBarColor} /> - + {/* When debug mode is enabled, the following information is displayed: From 0c8f9916c57d2440b8ea77a1a0ba8daa135bf1f0 Mon Sep 17 00:00:00 2001 From: Cristiano Tofani Date: Fri, 21 Feb 2025 10:00:36 +0100 Subject: [PATCH 3/3] fixes from review --- ts/App.tsx | 6 ++---- ts/RootContainer.tsx | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ts/App.tsx b/ts/App.tsx index 0e791daede1..70144174aae 100644 --- a/ts/App.tsx +++ b/ts/App.tsx @@ -49,7 +49,7 @@ Sentry.init({ Sentry.reactNativeTracingIntegration() ], enabled: !isDevEnv, - // https://sentry.zendesk.com/hc/en-us/articles/23337524872987-Why-is-the-the-message-in-my-error-being-truncated + // https://sentry.zendesk.com/hc/en-us/articles/23337524872987-Why-is-the-message-in-my-error-being-truncated maxValueLength: 3000, tracesSampleRate: 0.2, sampleRate: 0.3 @@ -74,9 +74,7 @@ const App = (): JSX.Element => ( - + diff --git a/ts/RootContainer.tsx b/ts/RootContainer.tsx index 719d5f02d10..1a15684fa77 100644 --- a/ts/RootContainer.tsx +++ b/ts/RootContainer.tsx @@ -28,13 +28,9 @@ import { } from "./store/reducers/persistedPreferences"; import { GlobalState } from "./store/reducers/types"; import customVariables from "./theme/variables"; -// import { ReactNavigationInstrumentation } from "./App"; import { setScreenReaderEnabled } from "./store/actions/preferences"; type Props = ReturnType & typeof mapDispatchToProps; -// & { -// routingInstumentation: ReactNavigationInstrumentation; -// }; /** * The main container of the application with: