Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove logrocket references #6370

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion infrastructure/nginx-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ add_header X-Permitted-Cross-Domain-Policies master-only;
# I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'
# directives for css and js(if you have inline css or js, you will need to keep it too).
# more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful
add_header Content-Security-Policy "default-src 'self' {{CONTENT_SECURITY_POLICY_WILDCARD}} *.logrocket.io/ *.sentry.io/ sentry.io/; font-src fonts.gstatic.com; object-src 'none'; script-src 'self' 'unsafe-eval' blob: https: http: storage.googleapis.com/workbox-cdn/ sentry.io/api/embed/error-page/; style-src 'self' fonts.googleapis.com 'unsafe-inline'; img-src 'self' data: http: https: ";
add_header Content-Security-Policy "default-src 'self' {{CONTENT_SECURITY_POLICY_WILDCARD}} *.sentry.io/ sentry.io/; font-src fonts.gstatic.com; object-src 'none'; script-src 'self' 'unsafe-eval' blob: https: http: storage.googleapis.com/workbox-cdn/ sentry.io/api/embed/error-page/; style-src 'self' fonts.googleapis.com 'unsafe-inline'; img-src 'self' data: http: https: ";

server {
listen 80;
Expand Down
11 changes: 5 additions & 6 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"lint-staged": "^7.1.0",
"localforage": "^1.7.2",
"lodash": "^4.17.10",
"logrocket": "^0.6.19",
"patch-package": "^6.1.2",
"pdfmake": "^0.2.5",
"postinstall-postinstall": "^2.0.0",
Expand Down Expand Up @@ -111,16 +110,16 @@
"xregexp": "^4.2.0"
},
"devDependencies": {
"@types/fhir": "^0.0.30",
"@opencrvs/commons": "^1.3.0",
"@opencrvs/gateway": "^1.3.0",
"@graphql-codegen/add": "^3.1.1",
"@graphql-codegen/cli": "^3.0.0",
"@graphql-codegen/introspection": "^3.0.0",
"@graphql-codegen/typescript": "^3.0.0",
"@graphql-codegen/typescript-operations": "^3.0.0",
"@opencrvs/commons": "^1.3.0",
"@opencrvs/gateway": "^1.3.0",
"@types/enzyme": "^3.1.13",
"@types/fetch-mock": "^7.3.0",
"@types/fhir": "^0.0.30",
"@types/google-libphonenumber": "^7.4.23",
"@types/handlebars": "^4.1.0",
"@types/jwt-decode": "^2.2.1",
Expand All @@ -147,15 +146,15 @@
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-formatjs": "2.17.2",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-prettier": "^4.0.0",
"jsonwebtoken": "^9.0.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-hooks": "^4.0.8",
"express": "^4.17.1",
"fetch-mock": "^7.3.3",
"glob": "^7.1.2",
"json2csv": "^4.3.2",
"jsonwebtoken": "^9.0.0",
"opener": "^1.5.1",
"prettier": "2.8.8",
"qrcode": "^1.5.1",
Expand Down
4 changes: 0 additions & 4 deletions packages/client/src/components/ProtectedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import IdleTimer from 'react-idle-timer'
import { USER_DETAILS, UserDetails } from '@client/utils/userUtils'
import { ProtectedAccount } from '@client/components/ProtectedAccount'
import { getCurrentUserID, IUserData } from '@client/declarations'
import * as LogRocket from 'logrocket'
import { refreshToken } from '@client/utils/authUtils'
import {
DESKTOP_TIME_OUT_MILLISECONDS,
Expand Down Expand Up @@ -112,9 +111,6 @@ class ProtectedPageComponent extends React.Component<Props, IProtectPageState> {
if (userDetails && userDetails.status && userDetails.status === 'pending') {
newState.pendingUser = true
}
if (userDetails && userDetails.practitionerId) {
LogRocket.identify(userDetails.practitionerId)
}

newState.loading = false
this.setState(newState)
Expand Down
26 changes: 0 additions & 26 deletions packages/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import * as actions from '@client/notification/actions'
import { storage } from '@client/storage'
// eslint-disable-next-line no-restricted-imports
import * as Sentry from '@sentry/react'
import * as LogRocket from 'logrocket'
import { SubmissionController } from '@client/SubmissionController'
import * as pdfjs from 'pdfjs-dist/build/pdf'
import WebFont from 'webfontloader'
Expand Down Expand Up @@ -53,31 +52,6 @@ if (
dsn: window.config.SENTRY
})
}

// setup log rocket to ship log messages and record user errors
if (window.config.LOGROCKET) {
LogRocket.init(window.config.LOGROCKET, {
release: import.meta.env.VITE_APP_VERSION
})
}

// Integrate the two
if (window.config.SENTRY && window.config.LOGROCKET) {
Sentry.configureScope((scope) => {
scope.addEventProcessor(async (event) => {
if (!event.extra) {
event.extra = {}
}
const sessionUrl = await new Promise((resolve) => {
LogRocket.getSessionURL((url) => {
resolve(url)
})
})
event.extra.sessionURL = sessionUrl
return event
})
})
}
}

function userReconnectedToast() {
Expand Down
1 change: 0 additions & 1 deletion packages/client/src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const config = {
USER_NOTIFICATION_DELIVERY_METHOD: 'sms',
INFORMANT_NOTIFICATION_DELIVERY_METHOD: 'sms',
SENTRY: 'https://2ed906a0ba1c4de2ae3f3f898ec9df0b@sentry.io/1774551',
LOGROCKET: 'opencrvs-foundation/opencrvs-bangladesh',
NID_NUMBER_PATTERN: /^[0-9]{9}$/,
PHONE_NUMBER_PATTERN: /^01[1-9][0-9]{8}$/
}
Expand Down
1 change: 0 additions & 1 deletion packages/client/src/tests/mock-offline-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ export const mockOfflineData = {
DEATH_REGISTRATION_TARGET: 45,
NID_NUMBER_PATTERN: /^[0-9]{9}$/,
SENTRY: 'https://sentry.com',
LOGROCKET: 'opencrvs-foundation/opencrvs-zambia',
DATE_OF_BIRTH_UNKNOWN: true,
INFORMANT_SIGNATURE_REQUIRED: false,
USER_NOTIFICATION_DELIVERY_METHOD: 'email',
Expand Down
1 change: 0 additions & 1 deletion packages/client/src/utils/referenceApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,6 @@ const mockFetchConfig = {
EXTERNAL_VALIDATION_WORKQUEUE: false,
PHONE_NUMBER_PATTERN: '/^0(7|9)[0-9]{1}[0-9]{7}$/',
SENTRY: 'https://f892d643aab642108f44e2d1795706bc@sentry.io/1774604',
LOGROCKET: 'opencrvs-foundation/opencrvs-zambia',
NID_NUMBER_PATTERN: '/^[0-9]{9}$/',
COUNTRY: 'zmb',
CURRENCY: {
Expand Down
1 change: 0 additions & 1 deletion packages/client/typings/window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ interface Window {
PHONE_NUMBER_PATTERN: RegExp
NID_NUMBER_PATTERN: RegExp
DECLARATION_AUDIT_LOCATIONS: string
LOGROCKET: string
SENTRY: string
DATE_OF_BIRTH_UNKNOWN: boolean
INFORMANT_SIGNATURE_REQUIRED: boolean
Expand Down
5 changes: 2 additions & 3 deletions packages/login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"license": "MPL-2.0",
"private": true,
"dependencies": {
"localforage": "^1.7.2",
"@opencrvs/components": "^1.3.0",
"@sentry/react": "^7.12.1",
"@sentry/tracing": "^7.12.1",
Expand All @@ -31,9 +30,9 @@
"google-libphonenumber": "^3.2.32",
"history": "^4.7.2",
"lint-staged": "^7.1.0",
"localforage": "^1.7.2",
"lodash": "^4.17.10",
"lodash-es": "^4.17.0",
"logrocket": "^0.6.19",
"patch-package": "^6.1.2",
"postinstall-postinstall": "^2.0.0",
"react": "18.2.0",
Expand Down Expand Up @@ -98,7 +97,6 @@
"jwt-decode": "^2.2.0",
"msw": "0.22.0",
"opener": "^1.5.1",
"typescript-react-intl": "^0.3.0",
"prettier": "2.8.8",
"redux-mock-store": "^1.5.3",
"serve": "^14.2.0",
Expand All @@ -108,6 +106,7 @@
"stylelint-processor-styled-components": "^1.10.0",
"ts-node": "^6.1.1",
"typescript": "4.9.3",
"typescript-react-intl": "^0.3.0",
"vite": "^3.0.0",
"vite-plugin-pwa": "^0.16.4",
"vite-plugin-svgr": "^0.3.0",
Expand Down
1 change: 0 additions & 1 deletion packages/login/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('Login app step one', () => {
COUNTRY_CONFIG_URL: 'http://localhost:3040',
PHONE_NUMBER_PATTERN: /^0(7|9)[0-9]{1}[0-9]{7}$/,
SENTRY: 'https://f892d643aab642108f44e2d1795706bc@sentry.io/1774604',
LOGROCKET: 'opencrvs-foundation/opencrvs-farajaland',
INFORMANT_NOTIFICATION_DELIVERY_METHOD: 'sms'
}
})
Expand Down
25 changes: 1 addition & 24 deletions packages/login/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import * as React from 'react'
import { createRoot } from 'react-dom/client'
import * as Sentry from '@sentry/react'
import * as LogRocket from 'logrocket'

import { App } from '@login/App'
import { storage } from '@login/storage'
import { createStore } from './store'
Expand Down Expand Up @@ -39,29 +39,6 @@ if (
tracesSampleRate: 1.0
})
}

// setup log rocket to ship log messages and record user errors
if (window.config.LOGROCKET) {
LogRocket.init(window.config.LOGROCKET)
}

// Integrate the two
if (window.config.SENTRY && window.config.LOGROCKET) {
Sentry.configureScope((scope) => {
scope.addEventProcessor(async (event) => {
if (!event.extra) {
event.extra = {}
}
const sessionUrl = await new Promise((resolve) => {
LogRocket.getSessionURL((url) => {
resolve(url)
})
})
event.extra.sessionURL = sessionUrl
return event
})
})
}
}
const { store, history } = createStore()

Expand Down
1 change: 0 additions & 1 deletion packages/login/src/utils/authApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface IApplicationConfig {
COUNTRY: string
COUNTRY_LOGO: ICountryLogo
SENTRY: string
LOGROCKET: string
LOGIN_BACKGROUND: ILoginBackground
USER_NOTIFICATION_DELIVERY_METHOD: string
INFORMANT_NOTIFICATION_DELIVERY_METHOD: string
Expand Down
1 change: 0 additions & 1 deletion packages/login/src/views/StepOne/stepOneContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ describe('Login app step one', () => {
imageFit: 'FILL'
},
SENTRY: '',
LOGROCKET: '',
USER_NOTIFICATION_DELIVERY_METHOD: 'sms',
INFORMANT_NOTIFICATION_DELIVERY_METHOD: 'sms'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ const server = setupServer(
fileName: 'dummy-file-name',
file: 'dummy-logo'
},
SENTRY: '',
LOGROCKET: ''
SENTRY: ''
}
})
)
Expand Down
1 change: 0 additions & 1 deletion packages/login/typings/window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ interface Window {
INFORMANT_NOTIFICATION_DELIVERY_METHOD: 'sms' | 'email'
CLIENT_APP_URL: string
PHONE_NUMBER_PATTERN: RegExp
LOGROCKET: string
SENTRY: string
}
}
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16443,11 +16443,6 @@ loglevel@^1.6.8:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.1.tgz#5c621f83d5b48c54ae93b6156353f555963377b4"
integrity sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==

logrocket@^0.6.19:
version "0.6.21"
resolved "https://registry.yarnpkg.com/logrocket/-/logrocket-0.6.21.tgz#f19749a4bc2ea51821a0f5acb08e811ac3d3f314"
integrity sha512-fyCA8PfNQqeuQyedqLQLiw47ibG8476a7C/amuusHKmqPdGo5GQmFD4Ba9vKRFbbakz+MmUdBGbYrQgq9K4e+g==

long@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
Expand Down
Loading