sentry-revert #217

Merged
andrey.dekterev merged 2 commits from sentry-revert into develop 3 years ago
  1. 105
      package-lock.json
  2. 1
      package.json
  3. 48
      src/components/ErrorBoundary/index.tsx
  4. 2
      src/features/App/index.tsx
  5. 9
      src/helpers/callApi/logoutIfUnauthorized.tsx
  6. 15
      src/index.tsx

105
package-lock.json generated

@ -3616,111 +3616,6 @@
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz",
"integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg=="
},
"@sentry-internal/tracing": {
"version": "7.53.1",
"resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.53.1.tgz",
"integrity": "sha512-a4H4rvVdz0XDGgNfRqc7zg6rMt2P1P05xBmgfIfztYy94Vciw1QMdboNiT7einr8ra8wogdEaK4Pe2AzYAPBJQ==",
"requires": {
"@sentry/core": "7.53.1",
"@sentry/types": "7.53.1",
"@sentry/utils": "7.53.1",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/browser": {
"version": "7.53.1",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.53.1.tgz",
"integrity": "sha512-1zas2R6riJaj0k7FoeieCW0SuC7UyKaBGA6jEG2LsgIqyD7IDOlF3BPZ4Yt08GFav0ImpyhGn5Vbrq5JLbeQdw==",
"requires": {
"@sentry-internal/tracing": "7.53.1",
"@sentry/core": "7.53.1",
"@sentry/replay": "7.53.1",
"@sentry/types": "7.53.1",
"@sentry/utils": "7.53.1",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/core": {
"version": "7.53.1",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.53.1.tgz",
"integrity": "sha512-DAH8IJNORJJ7kQLqsZuhMkN6cwJjXzFuuUoZor7IIDHIHjtl51W+2F3Stg3+I3ZoKDfJfUNKqhipk2WZjG0FBg==",
"requires": {
"@sentry/types": "7.53.1",
"@sentry/utils": "7.53.1",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/react": {
"version": "7.53.1",
"resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.53.1.tgz",
"integrity": "sha512-eEOY/peBepSD/nhPn4SU77aYdjQfAI1svOqpG4sbpjaGZU1P6L7+IIGmip8l2T68oPEeKDaiH9Qy/3uxu55B/Q==",
"requires": {
"@sentry/browser": "7.53.1",
"@sentry/types": "7.53.1",
"@sentry/utils": "7.53.1",
"hoist-non-react-statics": "^3.3.2",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/replay": {
"version": "7.53.1",
"resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.53.1.tgz",
"integrity": "sha512-5He5JLJiYLeWtXHC53z2ZzfbgAedafbHNZVS4+MBCOtydCk7cnuyJ0gGV6Rfxej/lZSNXZxOdW7HeMhzBtZCxw==",
"requires": {
"@sentry/core": "7.53.1",
"@sentry/types": "7.53.1",
"@sentry/utils": "7.53.1"
}
},
"@sentry/types": {
"version": "7.53.1",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.53.1.tgz",
"integrity": "sha512-/ijchRIu+jz3+j/zY+7KRPfLSCY14fTx5xujjbOdmEKjmIHQmwPBdszcQm40uwofrR8taV4hbt5MFN+WnjCkCw=="
},
"@sentry/utils": {
"version": "7.53.1",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.53.1.tgz",
"integrity": "sha512-DKJA1LSUOEv4KOR828MzVuLh+drjeAgzyKgN063OEKmnirgjgRgNNS8wUgwpG0Tn2k6ANZGCwrdfzPeSBxshKg==",
"requires": {
"@sentry/types": "7.53.1",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sinclair/typebox": {
"version": "0.24.51",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz",

@ -23,7 +23,6 @@
},
"dependencies": {
"@reactour/tour": "^3.3.0",
"@sentry/react": "^7.53.1",
"@stripe/react-stripe-js": "^1.4.0",
"@stripe/stripe-js": "^1.13.2",
"babel-polyfill": "^6.26.0",

@ -1,8 +1,8 @@
import React from 'react'
// eslint-disable react/destructuring-assignment
import type{ ReactNode } from 'react'
import { Component } from 'react'
import * as Sentry from '@sentry/react'
import type{ ErrorInfo, ReactNode } from 'react'
import { Error } from '../Error'
@ -10,15 +10,41 @@ interface Props {
children?: ReactNode,
}
export const ErrorBoundary = ({ children }: Props) => (
<Sentry.ErrorBoundary fallback={(
interface State {
hasError: boolean,
}
class ErrorBoundary extends Component<Props, State> {
// eslint-disable-next-line react/state-in-constructor
public state: State = {
hasError: false,
}
public static getDerivedStateFromError(_: Error): State {
// Update state so the next render will show the fallback UI.
return { hasError: true }
}
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
// eslint-disable-next-line no-console
console.error(
'Uncaught error:',
error,
errorInfo,
)
}
public render() {
const { hasError } = this.state
const { children } = this.props
return (
<>
{hasError && <Error />}
{children}
<Error />
</>
)}
>
{ children }
</Sentry.ErrorBoundary>
)
)
}
}
export default ErrorBoundary

@ -23,7 +23,7 @@ import { GlobalStyles } from 'features/GlobalStyles'
import { Theme } from 'features/Theme'
import { UnavailableText } from 'components/UnavailableText'
import { ErrorBoundary } from 'components/ErrorBoundary'
import ErrorBoundary from 'components/ErrorBoundary'
import { AuthenticatedApp } from './AuthenticatedApp'
import { useAuthStore } from '../AuthStore'

@ -1,13 +1,5 @@
import * as Sentry from '@sentry/react'
export const logoutIfUnauthorized = async (response: Response) => {
/* отключили из-за доступа без авторизации */
const body = await response.json()
if (response.status === 400) {
Sentry.captureException(body)
}
if (response.status === 401 || response.status === 403) {
window.dispatchEvent(new Event('FORBIDDEN_REQUEST'))
}
@ -16,5 +8,6 @@ export const logoutIfUnauthorized = async (response: Response) => {
// eslint-disable-next-line no-console
console.error(error)
const body = await response.json()
return Promise.reject(body)
}

@ -5,24 +5,11 @@ import {
} from 'react'
import ReactDOM from 'react-dom'
import * as Sentry from '@sentry/react'
import { BrowserTracing } from '@sentry/react'
import { isIOS, ENV } from 'config'
import { isIOS } from 'config/userAgent'
// import { makeServer } from 'utilits/mirage/Mirage'
import * as serviceWorker from './serviceWorker'
if (process.env.NODE_ENV !== 'development') {
Sentry.init({
dsn: 'https://bbe0cdfb954644ebaf3be16bb472cc3d@sentry.insports.tv/21',
environment: ENV,
integrations: [new BrowserTracing()],
tracesSampleRate: 1.0,
})
}
export const App = process.env.REACT_APP_TYPE === 'auth-service'
? lazy(() => import('features/AuthServiceApp'))
: lazy(() => import('features/App'))

Loading…
Cancel
Save