TP-30224 | GlitchTip Fix
This commit is contained in:
committed by
Aman Chaturvedi
parent
c6177a0017
commit
7169761473
9
App.tsx
9
App.tsx
@@ -18,7 +18,7 @@ import { navigationRef } from './src/components/utlis/navigationUtlis';
|
||||
import FullScreenLoader from './RN-UI-LIB/src/components/FullScreenLoader';
|
||||
import { toastConfigs, ToastContainer } from './RN-UI-LIB/src/components/toast';
|
||||
|
||||
import * as Sentry from '@sentry/browser';
|
||||
import * as Sentry from '@sentry/react-native';
|
||||
import { APM_APP_NAME, APM_BASE_URL, ENV, SENTRY_DSN } from './src/constants/config';
|
||||
import { COLORS } from './RN-UI-LIB/src/styles/colors';
|
||||
import codePush from 'react-native-code-push';
|
||||
@@ -31,12 +31,14 @@ import ErrorBoundary from './src/common/ErrorBoundary';
|
||||
import CodePush from 'react-native-code-push';
|
||||
import { TDocumentObj } from './src/screens/caseDetails/interface';
|
||||
import AuthRouter from './src/screens/auth/AuthRouter';
|
||||
import { initSentry } from './src/components/utlis/sentry';
|
||||
|
||||
Sentry.init({ dsn: SENTRY_DSN });
|
||||
|
||||
if (ENV !== 'prod') {
|
||||
// mockApiServer();
|
||||
}
|
||||
|
||||
setJsErrorHandler();
|
||||
LogBox.ignoreAllLogs();
|
||||
|
||||
@@ -88,6 +90,7 @@ const App = () => {
|
||||
});
|
||||
|
||||
React.useEffect(() => {
|
||||
initSentry();
|
||||
const appStateChange = AppState.addEventListener('change', (change) => {
|
||||
handleAppStateChange(change);
|
||||
askForPermissions(setPermissions);
|
||||
@@ -125,4 +128,6 @@ const App = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
const AppWithSentry = Sentry.wrap(App);
|
||||
|
||||
export default AppWithSentry;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"@react-navigation/native": "6.1.4",
|
||||
"@react-navigation/native-stack": "6.9.4",
|
||||
"@reduxjs/toolkit": "1.9.1",
|
||||
"@sentry/browser": "7.29.0",
|
||||
"@sentry/react-native": "5.5.0",
|
||||
"@supersami/rn-foreground-service": "^2.1.0",
|
||||
"appcenter": "^4.4.5",
|
||||
"appcenter-analytics": "^4.4.5",
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import * as Sentry from '@sentry/browser';
|
||||
import * as Sentry from '@sentry/react-native';
|
||||
import { GLOBAL } from '../../constants/Global';
|
||||
|
||||
export const logError = (error: Error, extraInfo = '') => {
|
||||
Sentry.setTag('agentId', GLOBAL.AGENT_ID || 'not-logged-in');
|
||||
Sentry.captureException({
|
||||
error,
|
||||
message: error?.message,
|
||||
extraInfo,
|
||||
deviceId: GLOBAL.DEVICE_ID,
|
||||
Sentry.captureException(error, (scope) => {
|
||||
scope.setExtra('ExtraInfo', extraInfo);
|
||||
return scope;
|
||||
});
|
||||
};
|
||||
|
||||
export const sentryCaptureMessage = (errorStr: string, extraInfo = '') => {
|
||||
Sentry.setTag('agentId', GLOBAL.AGENT_ID || 'not-logged-in');
|
||||
Sentry.captureMessage(errorStr, (scope) => {
|
||||
scope.setExtra('ExtraInfo', extraInfo);
|
||||
return scope;
|
||||
});
|
||||
};
|
||||
|
||||
34
src/components/utlis/sentry.ts
Normal file
34
src/components/utlis/sentry.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import * as Sentry from '@sentry/react-native';
|
||||
import VersionNumber from 'react-native-version-number';
|
||||
|
||||
import { SENTRY_DSN, ENV } from '../../constants/config';
|
||||
|
||||
const sentryRoutingInstrumentation = new Sentry.ReactNavigationInstrumentation();
|
||||
|
||||
const defaultOptions = {
|
||||
dsn: SENTRY_DSN,
|
||||
enableAutoSessionTracking: true,
|
||||
environment: ENV,
|
||||
integrations: [
|
||||
new Sentry.ReactNativeTracing({
|
||||
routingInstrumentation: sentryRoutingInstrumentation,
|
||||
tracingOrigins: ['localhost', /^\//],
|
||||
}),
|
||||
],
|
||||
tracesSampleRate: 0.2,
|
||||
};
|
||||
|
||||
export async function initSentry() {
|
||||
try {
|
||||
const dist = `${VersionNumber.buildVersion}`;
|
||||
const release = `${VersionNumber.bundleIdentifier}@${VersionNumber.appVersion}+${dist}`;
|
||||
|
||||
Sentry.init({
|
||||
...defaultOptions,
|
||||
dist,
|
||||
release,
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Sentry initialization failed');
|
||||
}
|
||||
}
|
||||
160
yarn.lock
160
yarn.lock
@@ -1729,46 +1729,113 @@
|
||||
redux-thunk "^2.4.2"
|
||||
reselect "^4.1.7"
|
||||
|
||||
"@sentry/browser@7.29.0":
|
||||
version "7.29.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.29.0.tgz#eb162b50adec33ac49ecd3dc930bdffbfda8098e"
|
||||
integrity sha512-Af+dIcntaw405Wt7myDOMGDxiszfy4aBdshrEKYbGgcfHjgXBIdF3iKlNatvl6nrOm+IOVuKgSpCLOr2hiCwzw==
|
||||
"@sentry-internal/tracing@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.52.0.tgz#c4e0750ad0c3949c5bb4b59cbb708b0fef274080"
|
||||
integrity sha512-o1YPcRGtC9tjeFCvWRJsbgK94zpExhzfxWaldAKvi3PuWEmPeewSdO/Q5pBIY1QonvSI+Q3gysLRcVlLYHhO5A==
|
||||
dependencies:
|
||||
"@sentry/core" "7.29.0"
|
||||
"@sentry/replay" "7.29.0"
|
||||
"@sentry/types" "7.29.0"
|
||||
"@sentry/utils" "7.29.0"
|
||||
"@sentry/core" "7.52.0"
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/core@7.29.0":
|
||||
version "7.29.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.29.0.tgz#bc4b54d56cf7652598d4430cf43ea97cc069f6fe"
|
||||
integrity sha512-+e9aIp2ljtT4EJq3901z6TfEVEeqZd5cWzbKEuQzPn2UO6If9+Utd7kY2Y31eQYb4QnJgZfiIEz1HonuYY6zqQ==
|
||||
"@sentry/browser@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.52.0.tgz#55d266c89ed668389ff687e5cc885c27016ea85c"
|
||||
integrity sha512-Sib0T24cQCqqqAhg+nZdfI7qNYGE03jiM3RbY7yG5UoycdnJzWEwrBVSzRTgg3Uya9TRTEGJ+d9vxPIU5TL7TA==
|
||||
dependencies:
|
||||
"@sentry/types" "7.29.0"
|
||||
"@sentry/utils" "7.29.0"
|
||||
"@sentry-internal/tracing" "7.52.0"
|
||||
"@sentry/core" "7.52.0"
|
||||
"@sentry/replay" "7.52.0"
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/replay@7.29.0":
|
||||
version "7.29.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.29.0.tgz#75d5bb9df39e0a31994be245032c9998af62a304"
|
||||
integrity sha512-Gw7HgviJQu6pX5RFQGVY38Av4qFn9otrZdwSSl/QK5hIyg6yhlh5h7U0ydZkrYYGiW6Z6SYYRpEWCJc/Wbh+ZQ==
|
||||
"@sentry/cli@2.17.5":
|
||||
version "2.17.5"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.17.5.tgz#d41e24893a843bcd41e14274044a7ddea9332824"
|
||||
integrity sha512-0tXjLDpaKB46851EMJ6NbP0o9/gdEaDSLAyjEtXxlVO6+RyhUj6x6jDwn0vis8n/7q0AvbIjAcJrot+TbZP+WQ==
|
||||
dependencies:
|
||||
"@sentry/core" "7.29.0"
|
||||
"@sentry/types" "7.29.0"
|
||||
"@sentry/utils" "7.29.0"
|
||||
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"
|
||||
|
||||
"@sentry/types@7.29.0":
|
||||
version "7.29.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.29.0.tgz#ed829b6014ee19049035fec6af2b4fea44ff28b8"
|
||||
integrity sha512-DmoEpoqHPty3VxqubS/5gxarwebHRlcBd/yuno+PS3xy++/i9YPjOWLZhU2jYs1cW68M9R6CcCOiC9f2ckJjdw==
|
||||
|
||||
"@sentry/utils@7.29.0":
|
||||
version "7.29.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.29.0.tgz#cbf8f87dd851b0fdc7870db9c68014c321c3bab8"
|
||||
integrity sha512-ICcBwTiBGK8NQA8H2BJo0JcMN6yCeKLqNKNMVampRgS6wSfSk1edvcTdhRkW3bSktIGrIPZrKskBHyMwDGF2XQ==
|
||||
"@sentry/core@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.52.0.tgz#6c820ca48fe2f06bfd6b290044c96de2375f2ad4"
|
||||
integrity sha512-BWdG6vCMeUeMhF4ILpxXTmw70JJvT1MGJcnv09oSupWHTmqy6I19YP6YcEyFuBL4jXPN51eCl7luIdLGJrPbOg==
|
||||
dependencies:
|
||||
"@sentry/types" "7.29.0"
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/hub@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.52.0.tgz#ffc087d58c745d57108862faa0f701b15503dcc2"
|
||||
integrity sha512-w3d8Pmp3Fx2zbbjz6hAeIbsFEkLyrUs9YTGG2y8oCoTlAtGK+AjdG+Z0H/clAZONflD/je2EmFHCI0EuXE9tEw==
|
||||
dependencies:
|
||||
"@sentry/core" "7.52.0"
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/integrations@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.52.0.tgz#632aa5e54bdfdab910a24057c2072634a2670409"
|
||||
integrity sha512-tqxYzgc71XdFD8MTCsVMCPef08lPY9jULE5Zi7TzjyV2AItDRJPkixG0qjwjOGwCtN/6KKz0lGPGYU8ZDxvsbg==
|
||||
dependencies:
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
localforage "^1.8.1"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/react-native@5.5.0":
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-5.5.0.tgz#b1283f68465b1772ad6059ebba149673cef33f2d"
|
||||
integrity sha512-xrES+OAIu3HFhoQSuJjd16Hh02/mByuNoKUjF7e4WDGIiTew3aqlqeLjU7x4npmg5Vbt+ND5jR12u/NmdfArwg==
|
||||
dependencies:
|
||||
"@sentry/browser" "7.52.0"
|
||||
"@sentry/cli" "2.17.5"
|
||||
"@sentry/core" "7.52.0"
|
||||
"@sentry/hub" "7.52.0"
|
||||
"@sentry/integrations" "7.52.0"
|
||||
"@sentry/react" "7.52.0"
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
|
||||
"@sentry/react@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.52.0.tgz#d12d270ec82dea0474e69deb9112181affe7c524"
|
||||
integrity sha512-VQxquyFFlvB81k7UER7tTJxjzbczNI2jqsw6nN1TVDrAIDt8/hT2x7m/M0FlWc88roBKuaMmbvzfNGWaL9abyQ==
|
||||
dependencies:
|
||||
"@sentry/browser" "7.52.0"
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
hoist-non-react-statics "^3.3.2"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/replay@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.52.0.tgz#4d78e88282d2c1044ea4b648a68d1b22173e810d"
|
||||
integrity sha512-RRPALjDST2s7MHiMcUJ7Wo4WW7EWfUDYSG0LuhMT8DNc+ZsxQoFsLYX/yz8b3f0IUSr7xKBXP+aPeIy3jDAS2g==
|
||||
dependencies:
|
||||
"@sentry/core" "7.52.0"
|
||||
"@sentry/types" "7.52.0"
|
||||
"@sentry/utils" "7.52.0"
|
||||
|
||||
"@sentry/types@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.52.0.tgz#b7d5372f17355e3991cbe818ad567f3fe277cc6b"
|
||||
integrity sha512-XnEWpS6P6UdP1FqbmeqhI96Iowqd2jM5R7zJ97txTdAd5NmdHHH0pODTR9NiQViA1WlsXDut7ZLxgPzC9vIcMA==
|
||||
|
||||
"@sentry/utils@7.52.0":
|
||||
version "7.52.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.52.0.tgz#cacc36d905036ba7084c14965e964fc44239d7f0"
|
||||
integrity sha512-X1NHYuqW0qpZfP731YcVe+cn36wJdAeBHPYPIkXCl4o4GePCJfH/CM/+9V9cZykNjyLrs2Xy/TavSAHNCj8j7w==
|
||||
dependencies:
|
||||
"@sentry/types" "7.52.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sideway/address@^4.1.3":
|
||||
@@ -4858,6 +4925,11 @@ image-size@^0.6.0:
|
||||
resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.6.3.tgz#e7e5c65bb534bd7cdcedd6cb5166272a85f75fb2"
|
||||
integrity sha512-47xSUiQioGaB96nqtp5/q55m0aBQSQdyIloMOc/x+QVTDZLNmXE892IIDrJ0hM1A5vcNUDD5tDffkSP5lCaIIA==
|
||||
|
||||
immediate@~3.0.5:
|
||||
version "3.0.6"
|
||||
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
|
||||
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
|
||||
|
||||
immer@^9.0.16:
|
||||
version "9.0.16"
|
||||
resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.16.tgz#8e7caab80118c2b54b37ad43e05758cdefad0198"
|
||||
@@ -5977,6 +6049,13 @@ levn@~0.3.0:
|
||||
prelude-ls "~1.1.2"
|
||||
type-check "~0.3.2"
|
||||
|
||||
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"
|
||||
@@ -6020,6 +6099,13 @@ listr2@^5.0.7:
|
||||
through "^2.3.8"
|
||||
wrap-ansi "^7.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@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
|
||||
@@ -6825,6 +6911,13 @@ node-fetch@^2.2.0, node-fetch@^2.6.0:
|
||||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
node-fetch@^2.6.7:
|
||||
version "2.6.11"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25"
|
||||
integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==
|
||||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
node-int64@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
|
||||
@@ -7387,6 +7480,11 @@ process-nextick-args@~2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
|
||||
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
|
||||
|
||||
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@^8.1.3:
|
||||
version "8.3.0"
|
||||
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.3.0.tgz#9284810268138d103807b11f4e23d5e945a4db63"
|
||||
|
||||
Reference in New Issue
Block a user