diff --git a/.env.local b/.env.local index 09bc595fd18..ae3da5b7541 100644 --- a/.env.local +++ b/.env.local @@ -31,6 +31,9 @@ ZENDESK_PRIVACY_URL='https://www.pagopa.it/it/privacy-policy-assistenza/' # Mixpanel MIXPANEL_URL='https://api-eu.mixpanel.com' MIXPANEL_TOKEN='0cb505dace6f4b3ceb9e17c7fcd7c66f' +# Sentry +# This can be public as per docs https://docs.sentry.io/concepts/key-terms/dsn-explainer/#dsn-utilization +SENTRY_DSN='https://43b87dcfc91f9cfdfaf71b254eb8f58e@o4507197393469440.ingest.de.sentry.io/4507221483585616' # Test overlay caption, if the string is nonempty will be displayed in the TestOverlay # TEST_OVERLAY_CAPTION='Functionality name here!' # enable playgrounds inside developer section diff --git a/.env.production b/.env.production index 4c4075ebff7..0d6ea7cbd8a 100644 --- a/.env.production +++ b/.env.production @@ -31,6 +31,9 @@ ZENDESK_PRIVACY_URL='https://www.pagopa.it/it/privacy-policy-assistenza/' # Mixpanel MIXPANEL_URL='https://api-eu.mixpanel.com' MIXPANEL_TOKEN='0cb505dace6f4b3ceb9e17c7fcd7c66f' +# Sentry +# This can be public as per docs https://docs.sentry.io/concepts/key-terms/dsn-explainer/#dsn-utilization +SENTRY_DSN='https://43b87dcfc91f9cfdfaf71b254eb8f58e@o4507197393469440.ingest.de.sentry.io/4507221483585616' # Test overlay caption, if the string is nonempty will be displayed in the TestOverlay # TEST_OVERLAY_CAPTION='Functionality name here!' # enable playgrounds inside developer section diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2496a0798fa..0860eea5d0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,7 @@ jobs: ENCODED_IOAPP_GOOGLE_SERVICES_JSON_FILE: ${{secrets.ENCODED_IOAPP_GOOGLE_SERVICES_JSON_FILE}} ENCODED_IOAPP_JSON_KEY_FILE: ${{secrets.ENCODED_IOAPP_JSON_KEY_FILE}} ENCODED_IO_APP_RELEASE_KEYSTORE: ${{secrets.ENCODED_IO_APP_RELEASE_KEYSTORE}} + ENCODED_IO_APP_SENTRY_PROPERTIES: ${{secrets.ENCODED_IO_APP_SENTRY_PROPERTIES}} IO_APP_RELEASE_STORE_FILE : ${{secrets.IO_APP_RELEASE_STORE_FILE}} IO_APP_RELEASE_STORE_PASSWORD: ${{secrets.IO_APP_RELEASE_STORE_PASSWORD}} IO_APP_RELEASE_KEY_ALIAS: ${{secrets.IO_APP_RELEASE_KEY_ALIAS}} @@ -66,6 +67,7 @@ jobs: env: APP_STORE_API_KEY_ID: ${{secrets.APP_STORE_API_KEY_ID}} APP_STORE_API_PRIVATE_KEY: ${{secrets.APP_STORE_API_PRIVATE_KEY}} + ENCODED_IO_APP_SENTRY_PROPERTIES: ${{secrets.ENCODED_IO_APP_SENTRY_PROPERTIES}} - id: add-ssh-deploy-key run: | echo -e "Host github.com diff --git a/.gitignore b/.gitignore index 937e84b7133..724a77418fc 100644 --- a/.gitignore +++ b/.gitignore @@ -106,8 +106,11 @@ GeneratedDotEnv.m # XState Typegen **/*.typegen.* +# Sentry prop file +sentry.properties + # Temporary files created by Metro to check the health of the file watcher .metro-health-check* # yarn cache dir -.yarn/cache \ No newline at end of file +.yarn/cache diff --git a/android/app/build.gradle b/android/app/build.gradle index 54cfba7ee36..7529c17d870 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -84,6 +84,7 @@ def enableProguardInReleaseBuilds = false */ def jscFlavor = 'org.webkit:android-jsc:+' +apply from: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../sentry.gradle") android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion diff --git a/index.js b/index.js index 781371b2f07..bb56c1c2e9d 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +/* eslint-disable functional/immutable-data */ /** * Main app entrypoint */ @@ -38,6 +39,7 @@ const errorHandler = (e, isFatal) => { ` ); } else { + // eslint-disable-next-line no-console console.log(e); // So that we can see it in the ADB logs in case of Android if needed } }; diff --git a/ios/ItaliaApp.xcodeproj/project.pbxproj b/ios/ItaliaApp.xcodeproj/project.pbxproj index e3eea493965..1423f821a6c 100644 --- a/ios/ItaliaApp.xcodeproj/project.pbxproj +++ b/ios/ItaliaApp.xcodeproj/project.pbxproj @@ -308,6 +308,7 @@ 7A034949213D55CA0064B689 /* Work around InputMask.xcodeproj embedding an extra set of Swift libraries */, 520BD832C8035EF5E68D9913 /* [CP] Embed Pods Frameworks */, 963519164D766C5238AA1B42 /* [CP] Copy Pods Resources */, + 749771495C064EBF91231ED5 /* Upload Debug Symbols to Sentry */, ); buildRules = ( ); @@ -502,18 +503,34 @@ "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/Sentry/Sentry.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Alamofire.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Sentry.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ItaliaApp-ItaliaAppTests/Pods-ItaliaApp-ItaliaAppTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 749771495C064EBF91231ED5 /* Upload Debug Symbols to Sentry */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Upload Debug Symbols to Sentry"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh"; + }; 7A034949213D55CA0064B689 /* Work around InputMask.xcodeproj embedding an extra set of Swift libraries */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -556,12 +573,14 @@ "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/Sentry/Sentry.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Alamofire.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Sentry.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 566620a501f..66bf57840b9 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -654,10 +654,16 @@ PODS: - RCT-Folly (= 2021.07.22.00) - React-Core - React-RCTImage + - RNSentry (5.22.2): + - hermes-engine + - React-Core + - React-hermes + - Sentry/HybridSDK (= 8.25.0) - RNShare (7.3.9): - React-Core - RNSVG (15.1.0): - React-Core + - Sentry/HybridSDK (8.25.0) - SocketRocket (0.6.1) - vision-camera-code-scanner (0.2.0): - GoogleMLKit/BarcodeScanning @@ -803,6 +809,7 @@ DEPENDENCIES: - RNReactNativeHapticFeedback (from `../node_modules/react-native-haptic-feedback`) - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) + - "RNSentry (from `../node_modules/@sentry/react-native`)" - RNShare (from `../node_modules/react-native-share`) - RNSVG (from `../node_modules/react-native-svg`) - vision-camera-code-scanner (from `../node_modules/vision-camera-code-scanner`) @@ -838,6 +845,7 @@ SPEC REPOS: - nanopb - OpenSSL-Universal - PromisesObjC + - Sentry - SocketRocket - YogaKit - ZendeskAnswerBotProvidersSDK @@ -1020,6 +1028,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-reanimated" RNScreens: :path: "../node_modules/react-native-screens" + RNSentry: + :path: "../node_modules/@sentry/react-native" RNShare: :path: "../node_modules/react-native-share" RNSVG: @@ -1142,8 +1152,10 @@ SPEC CHECKSUMS: RNReactNativeHapticFeedback: 6d24decfa94e037c2ecc312407d2a057b7933f10 RNReanimated: 108a53626a492df35db30b98fc922a7189d1c601 RNScreens: b8d370282cdeae9df85dd5eab20c88eb5181243b + RNSentry: f6a5aee809d646763640130714d1fdfe69aac36b RNShare: 807d6f8231b8ebcf6dd839294b877342eb93d4e5 RNSVG: 50cf2c7018e57cf5d3522d98d0a3a4dd6bf9d093 + Sentry: cd86fc55628f5b7c572cabe66cc8f95a9d2f165a SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 vision-camera-code-scanner: dda884a7f3ec8243a2a6d6489b91860648371bca VisionCamera: 8bc0089891097ab368afd7b699cc3e239871235c diff --git a/jest-e2e.config.js b/jest-e2e.config.js index fed9fc6301d..a0ae36ad81e 100644 --- a/jest-e2e.config.js +++ b/jest-e2e.config.js @@ -1,7 +1,7 @@ module.exports = { preset: "react-native", transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|@sentry/react-native)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/jest.config.js b/jest.config.js index 1da09771056..5a0021a142a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,7 @@ module.exports = { preset: "react-native", transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|uuid)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|uuid|@sentry/react-native)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/jest.config.no.timezone.js b/jest.config.no.timezone.js index 04721ac3cd3..c18a544d4b3 100644 --- a/jest.config.no.timezone.js +++ b/jest.config.no.timezone.js @@ -4,7 +4,7 @@ module.exports = { "^.+\\.js$": "/node_modules/react-native/jest/preprocessor.js" }, transformIgnorePatterns: [ - "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system)" + "node_modules/(?!(jest-)?@react-native|react-native|react-navigation|@react-navigation|react-navigation-redux-helpers|react-native-device-info|rn-placeholder|jsbarcode|@pagopa/react-native-cie|react-native-share|jail-monkey|@react-native-community/art|@react-native-community/push-notification-ios|@react-native-camera-roll/camera-roll|@codler|remark|unified|bail|is-plain-obj|trough|vfile|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|parse-entities|character-entities|mdast-util-to-markdown|zwitch|longest-streak|@pagopa/io-react-native-zendesk|rn-qr-generator|mixpanel-react-native|@pagopa/io-app-design-system|@sentry/react-native)" ], moduleNameMapper: { "\\.svg": "/ts/__mocks__/svgMock.js" diff --git a/locales/en/index.yml b/locales/en/index.yml index 87681570476..24af4286ada 100644 --- a/locales/en/index.yml +++ b/locales/en/index.yml @@ -315,6 +315,7 @@ profile: forgetCurrentSession: Forget current session clearAsyncStorage: Clear AsyncStorage dumpAsyncStorage: Dump AsyncStorage content to console + sentryTestEvent: Send Exception to Sentry contextualHelpTitle: What you can do in your Profile contextualHelpContent: !include profile/profile_account_main.md developerModeOn: Developer mode enabled diff --git a/locales/it/index.yml b/locales/it/index.yml index 58a495f647d..9358c5d38f6 100644 --- a/locales/it/index.yml +++ b/locales/it/index.yml @@ -315,6 +315,7 @@ profile: forgetCurrentSession: Dimentica sessione corrente clearAsyncStorage: Cancella contenuto di AsyncStorage dumpAsyncStorage: Scarica contenuto di AsyncStorage + sentryTestEvent: Invia Exception a Sentry contextualHelpTitle: Cosa puoi fare nel tuo Profilo contextualHelpContent: !include profile/profile_account_main.md developerModeOn: Modalità sviluppatore attivata diff --git a/metro.config.js b/metro.config.js index d10178991d0..78a7c66034b 100644 --- a/metro.config.js +++ b/metro.config.js @@ -1,4 +1,9 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable functional/immutable-data */ const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config"); +const { + createSentryMetroSerializer +} = require("@sentry/react-native/dist/js/tools/sentryMetroSerializer"); const { resolver: { sourceExts, assetExts } @@ -9,6 +14,9 @@ const withE2ESourceExts = process.env.RN_SRC_EXT : sourceExts; const config = { + serializer: { + customSerializer: createSentryMetroSerializer() + }, transformer: { babelTransformerPath: require.resolve("react-native-svg-transformer") }, diff --git a/package.json b/package.json index e0067e84f90..1f56ece976f 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,7 @@ "@react-navigation/native": "6.1.9", "@react-navigation/stack": "6.3.20", "@redux-saga/testing-utils": "^1.1.3", + "@sentry/react-native": "^5.22.2", "@shopify/flash-list": "~1.4.3", "@xstate/react": "^3.0.1", "@xstate5/react": "npm:@xstate/react@4", diff --git a/scripts/android-release.sh b/scripts/android-release.sh index 34ee5ed0ce6..45fa27562a2 100755 --- a/scripts/android-release.sh +++ b/scripts/android-release.sh @@ -7,4 +7,7 @@ echo $ENCODED_IOAPP_GOOGLE_SERVICES_JSON_FILE | base64 --decode > $1/google-serv echo $ENCODED_IOAPP_JSON_KEY_FILE | base64 --decode > /tmp/json-key.json # Recreate keystore from ENV variable -echo $ENCODED_IO_APP_RELEASE_KEYSTORE | base64 --decode > /tmp/ioapp-release.keystore \ No newline at end of file +echo $ENCODED_IO_APP_RELEASE_KEYSTORE | base64 --decode > /tmp/ioapp-release.keystore + +# Recreate sentry.properties from ENV variable +echo $ENCODED_IO_APP_SENTRY_PROPERTIES | base64 --decode > ./android/sentry.properties \ No newline at end of file diff --git a/scripts/ios-release-build.sh b/scripts/ios-release-build.sh index b942c20a5d6..a715bb39c44 100755 --- a/scripts/ios-release-build.sh +++ b/scripts/ios-release-build.sh @@ -1,6 +1,8 @@ #!/bin/bash cp .env.production .env +# Recreate sentry.properties from ENV variable +echo $ENCODED_IO_APP_SENTRY_PROPERTIES | base64 --decode > ./ios/sentry.properties yarn postinstall yarn cie-ios:ci touch ./ios/fastlane/AuthKey_$APP_STORE_API_KEY_ID.p8 diff --git a/ts/App.tsx b/ts/App.tsx index 192314c7eec..73c76843c03 100644 --- a/ts/App.tsx +++ b/ts/App.tsx @@ -9,9 +9,38 @@ import { GestureHandlerRootView } from "react-native-gesture-handler"; import { SafeAreaProvider } from "react-native-safe-area-context"; import { Provider } from "react-redux"; import { PersistGate } from "redux-persist/integration/react"; +import * as Sentry from "@sentry/react-native"; +import { ErrorEvent, TransactionEvent } from "@sentry/types"; import RootContainer from "./RootContainer"; import { persistor, store } from "./boot/configureStoreAndPersistor"; import { LightModalProvider } from "./components/ui/LightModal"; +import { sentryDsn } from "./config"; +import { isLocalEnv } from "./utils/environment"; + +const removeUserFromEvent = (event: ErrorEvent | TransactionEvent) => { + // console.log(JSON.stringify(event)); + // Modify or drop the event here + if (event.user) { + // Don't send user's email address + return { ...event, user: undefined }; + } + return event; +}; + +Sentry.setUser(null); + +Sentry.init({ + dsn: sentryDsn, + beforeSend(event) { + return removeUserFromEvent(event); + }, + // eslint-disable-next-line sonarjs/no-identical-functions + beforeSendTransaction(event) { + return removeUserFromEvent(event); + }, + enabled: !isLocalEnv, + sampleRate: 0.3 +}); // Infer the `RootState` and `AppDispatch` types from the store itself export export type RootState = ReturnType; diff --git a/ts/config.ts b/ts/config.ts index 174c24247fa..a82bc48c7b4 100644 --- a/ts/config.ts +++ b/ts/config.ts @@ -42,6 +42,10 @@ const DEFAULT_PAGE_SIZE = 12; // Default mixpanel EU url const DEFAULT_MIXPANEL_URL = "https://api-eu.mixpanel.com"; +// Default sentry dsn url +// This can be public as per docs https://docs.sentry.io/concepts/key-terms/dsn-explainer/#dsn-utilization +const DEFAULT_SENTRY_DSN = + "https://43b87dcfc91f9cfdfaf71b254eb8f58e@o4507197393469440.ingest.de.sentry.io/4507221483585616"; export const environment: string = Config.ENVIRONMENT; export const apiUrlPrefix: string = Config.API_URL_PREFIX; @@ -53,6 +57,11 @@ export const mixpanelUrl = pipe( E.getOrElse(() => DEFAULT_MIXPANEL_URL) ); export const mixpanelToken: string = Config.MIXPANEL_TOKEN; +export const sentryDsn: string = pipe( + Config.SENTRY_DSN, + NonEmptyString.decode, + E.getOrElse(() => DEFAULT_SENTRY_DSN) +); export const isDebugBiometricIdentificationEnabled = Config.DEBUG_BIOMETRIC_IDENTIFICATION === "YES"; diff --git a/ts/screens/profile/DeveloperModeSection.tsx b/ts/screens/profile/DeveloperModeSection.tsx index 63eca11eaf0..0937c0a9924 100644 --- a/ts/screens/profile/DeveloperModeSection.tsx +++ b/ts/screens/profile/DeveloperModeSection.tsx @@ -13,6 +13,7 @@ import { useIOTheme, useIOThemeContext } from "@pagopa/io-app-design-system"; +import * as Sentry from "@sentry/react-native"; import AsyncStorage from "@react-native-async-storage/async-storage"; import * as React from "react"; import { ComponentProps } from "react"; @@ -110,6 +111,10 @@ const DeveloperActionsSection = () => { ); }; + const sendSentryTestEvent = () => { + Sentry.captureException(new Error("Random test Error")); + }; + const dumpAsyncStorage = () => { /* eslint-disable no-console */ console.log("[DUMP START]"); @@ -152,6 +157,12 @@ const DeveloperActionsSection = () => { color: "primary", label: I18n.t("profile.main.dumpAsyncStorage"), onPress: dumpAsyncStorage + }, + { + condition: true, + color: "primary", + label: I18n.t("profile.main.sentryTestEvent"), + onPress: sendSentryTestEvent } ]; diff --git a/yarn.lock b/yarn.lock index 5c63353e38d..2955c1083eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2603,6 +2603,176 @@ resolved "https://registry.yarnpkg.com/@redux-saga/types/-/types-1.1.0.tgz#0e81ce56b4883b4b2a3001ebe1ab298b84237204" integrity sha512-afmTuJrylUU/0OtqzaRkbyYFFNgCF73Bvel/sw90pvGrWIZ+vyoIJqA6eMSoA6+nb443kTmulmBtC9NerXboNg== +"@sentry-internal/feedback@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.113.0.tgz#90a3c5493e289d589cfde79330fca549a24f41a4" + integrity sha512-eEmL8QXauUnM3FXGv0GT29RpL0Jo0pkn/uMu3aqjhQo7JKNqUGVYIUxJxiGWbVMbDXqPQ7L66bjjMS3FR1GM2g== + dependencies: + "@sentry/core" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry-internal/replay-canvas@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.113.0.tgz#8a0165494b0a0ba7b1ae45166ca90a8749c38b7a" + integrity sha512-K8uA42aobNF/BAXf14el15iSAi9fonLBUrjZi6nPDq7zaA8rPvfcTL797hwCbqkETz2zDf52Jz7I3WFCshDoUw== + dependencies: + "@sentry/core" "7.113.0" + "@sentry/replay" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry-internal/tracing@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.113.0.tgz#936f23205ab53be62f1753b923eddc243cefde86" + integrity sha512-8MDnYENRMnEfQjvN4gkFYFaaBSiMFSU/6SQZfY9pLI3V105z6JQ4D0PGMAUVowXilwNZVpKNYohE7XByuhEC7Q== + dependencies: + "@sentry/core" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry/browser@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.113.0.tgz#09b77812cbf476eacdccdc714ba4e4ba2c170a88" + integrity sha512-PdyVHPOprwoxGfKGsP2dXDWO0MBDW1eyP7EZlfZvM1A4hjk6ZRNfCv30g+TrqX4hiZDKzyqN3+AdP7N/J2IX0Q== + dependencies: + "@sentry-internal/feedback" "7.113.0" + "@sentry-internal/replay-canvas" "7.113.0" + "@sentry-internal/tracing" "7.113.0" + "@sentry/core" "7.113.0" + "@sentry/integrations" "7.113.0" + "@sentry/replay" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry/cli-darwin@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.30.4.tgz#1726461997cd78f01c5f005528683092419b1b57" + integrity sha512-d61JxgtPvUtUZ58T4WgzFDsRODAQbKcRxhK9DY7Y/+q7fH1gWc6J8s8RwxxhYu/N/UuWnAcXNtIH9daUanKTjQ== + +"@sentry/cli-linux-arm64@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.30.4.tgz#edbcfde267abad123fe92ebd37151ab3e15dc575" + integrity sha512-XxRBiZAj84umr+i4n6zNGkbdJIX76G6SFalv4466XZkbhPuAeSABFQ5PxRVc+j7pLyOBGao4q2yiO8wrBLsJug== + +"@sentry/cli-linux-arm@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.30.4.tgz#86961eaa16c731dd1ade5dfc728a001b1a6cefb8" + integrity sha512-2+L8FVOc8XLD2k4rUklsIG8gCoawOZJv1TdlHcIvsHIt6e55vVil6JDBc7dOD/tzJlJPAs+LMOuHHe8e/F+Y5A== + +"@sentry/cli-linux-i686@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.30.4.tgz#b35c7bec0d6d7680bd0d53fa42676dc40031bc5a" + integrity sha512-ruouCpmxJXumNxvZ4asQzz2gzAKeUhg9dofB9h5PEmemceTLKfOAyfplD5l1iLWL3+JfF88SNeuu2/sWHP7aBg== + +"@sentry/cli-linux-x64@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.30.4.tgz#77e77abf2b2356eb18ce386db07dbb6d786a566e" + integrity sha512-Kcb1Fn5wNSQW5bKkF35MpJSATtvgzGAHDzJkuEXPfF9xQMhOaYPnMN/D0aLYZgTpQawL4CM7dcfLuaafGmiazQ== + +"@sentry/cli-win32-i686@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.30.4.tgz#714ec71dbe1e5ef98af3f5f37bd1adcc5dc9dbd7" + integrity sha512-FJ6IS+N7CsacDiHrFbE4Ic9UmumsiaBSD4SiQMIG2wfM7Ig1hc7+F4xoMC3MjivAIM7F94ZdSt0aZDGwE+zYeg== + +"@sentry/cli-win32-x64@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.30.4.tgz#00bc0f765bfa0abdf327a9d56e2bb0f2277a9981" + integrity sha512-wzvMpj+AVEaLKKLkN1vZxuEwQJa5s8qiasYMBJTXFtD7+LqrONerHCRqk79W+60IBXX7MQSRFF3IsjVJzJGEjA== + +"@sentry/cli@2.30.4": + version "2.30.4" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.30.4.tgz#29b3217165c923a2b64c99d8c1643fcc6d3205df" + integrity sha512-5zYdNGK2sNiP0zbnzMWuwm71KlCWLISbiJDyFQk6YYTKLh2RIYBPLF5mNLBxE2Ns4/wuKuBZjqE2ESLS5FzoOw== + dependencies: + https-proxy-agent "^5.0.0" + node-fetch "^2.6.7" + progress "^2.0.3" + proxy-from-env "^1.1.0" + which "^2.0.2" + optionalDependencies: + "@sentry/cli-darwin" "2.30.4" + "@sentry/cli-linux-arm" "2.30.4" + "@sentry/cli-linux-arm64" "2.30.4" + "@sentry/cli-linux-i686" "2.30.4" + "@sentry/cli-linux-x64" "2.30.4" + "@sentry/cli-win32-i686" "2.30.4" + "@sentry/cli-win32-x64" "2.30.4" + +"@sentry/core@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.113.0.tgz#84307eabf03ece9304894ad24ee15581a220c5c7" + integrity sha512-pg75y3C5PG2+ur27A0Re37YTCEnX0liiEU7EOxWDGutH17x3ySwlYqLQmZsFZTSnvzv7t3MGsNZ8nT5O0746YA== + dependencies: + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry/hub@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.113.0.tgz#12f14071f43e657cd36174ba8b06cc955da5492f" + integrity sha512-aoerhlAw3vnY9a27eKAoK862oMXFbyMFWbaZuCeR5gfg7sHsOkVQkCl3yiYfF5hfw9MbwbbY6GqWbCrA89Ci/A== + dependencies: + "@sentry/core" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry/integrations@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.113.0.tgz#cce71e07cf90c4bf9b22f85c3ce22d9ba926ae5a" + integrity sha512-w0sspGBQ+6+V/9bgCkpuM3CGwTYoQEVeTW6iNebFKbtN7MrM3XsGAM9I2cW1jVxFZROqCBPFtd2cs5n0j14aAg== + dependencies: + "@sentry/core" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + localforage "^1.8.1" + +"@sentry/react-native@^5.22.2": + version "5.22.2" + resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-5.22.2.tgz#08d47d03fc01df3141c124d99ade57bc574b9097" + integrity sha512-q/Yg+oE2+jHIH2gRXI2NGYr4+vMGTAU2um4WGrMgEWWYc3QpG78SW7CVFHbdId7VETN3cLKB//twexWRuvvfZg== + dependencies: + "@sentry/browser" "7.113.0" + "@sentry/cli" "2.30.4" + "@sentry/core" "7.113.0" + "@sentry/hub" "7.113.0" + "@sentry/integrations" "7.113.0" + "@sentry/react" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry/react@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.113.0.tgz#8e21c92e9691ea881639596d7e60a996b23ba229" + integrity sha512-+zVPz+h5Wydq4ntekw3/dXq5jeHIpZoQ2iqhB96PA9Y94JIq178i/xIP204S1h6rN7cmWAqtR93vnPKdxnlUbQ== + dependencies: + "@sentry/browser" "7.113.0" + "@sentry/core" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + hoist-non-react-statics "^3.3.2" + +"@sentry/replay@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.113.0.tgz#db41b792e5d9966a9b1ca4eb1695ad7100f39b50" + integrity sha512-UD2IaphOWKFdeGR+ZiaNAQ+wFsnwbJK6PNwcW6cHmWKv9COlKufpFt06lviaqFZ8jmNrM4H+r+R8YVTrqCuxgg== + dependencies: + "@sentry-internal/tracing" "7.113.0" + "@sentry/core" "7.113.0" + "@sentry/types" "7.113.0" + "@sentry/utils" "7.113.0" + +"@sentry/types@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.113.0.tgz#2193c9933838302c82814771b03a8647fa684ffb" + integrity sha512-PJbTbvkcPu/LuRwwXB1He8m+GjDDLKBtu3lWg5xOZaF5IRdXQU2xwtdXXsjge4PZR00tF7MO7X8ZynTgWbYaew== + +"@sentry/utils@7.113.0": + version "7.113.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.113.0.tgz#1e6e790c9d84e4809b2bb529bbd33a506b6db7bd" + integrity sha512-nzKsErwmze1mmEsbW2AwL2oB+I5v6cDEJY4sdfLekA4qZbYZ8pV5iWza6IRl4XfzGTE1qpkZmEjPU9eyo0yvYw== + dependencies: + "@sentry/types" "7.113.0" + "@shopify/flash-list@~1.4.3": version "1.4.3" resolved "https://registry.yarnpkg.com/@shopify/flash-list/-/flash-list-1.4.3.tgz#b7a4fe03d64f3c5ce9646859b49b9d95307f203d" @@ -8405,6 +8575,11 @@ image-size@^1.0.2: dependencies: queue "6.0.2" +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== + import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" @@ -10161,6 +10336,13 @@ li@^1.3.0: resolved "https://registry.yarnpkg.com/li/-/li-1.3.0.tgz#22c59bcaefaa9a8ef359cf759784e4bf106aea1b" integrity sha1-IsWbyu+qmo7zWc91l4TkvxBq6hs= +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== + dependencies: + immediate "~3.0.5" + lilconfig@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" @@ -10232,6 +10414,13 @@ load-json-file@^4.0.0: pify "^3.0.0" strip-bom "^3.0.0" +localforage@^1.8.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" + integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== + dependencies: + lie "3.1.1" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -12566,6 +12755,11 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= +progress@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + promise-polyfill@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-6.1.0.tgz#dfa96943ea9c121fca4de9b5868cb39d3472e057" @@ -12625,7 +12819,7 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -proxy-from-env@^1.0.0: +proxy-from-env@^1.0.0, proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== @@ -15823,7 +16017,7 @@ which@^1.2.9, which@^1.3.1: dependencies: isexe "^2.0.0" -which@^2.0.1: +which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==