Skip to content

Commit

Permalink
fix: remove rollbar (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber authored Jan 9, 2024
1 parent e44100e commit 94651f6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 110 deletions.
67 changes: 4 additions & 63 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"react-i18next": "^13.4.1",
"react-redux": "^8.1.3",
"react-router-dom": "^6.21.1",
"rollbar": "^2.26.2",
"scrollama": "^3.2.0",
"slate-history": "^0.100.0",
"slate-hyperscript": "^0.100.0",
Expand Down
6 changes: 1 addition & 5 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import _ from 'lodash/fp';
import { setAPIConfig } from 'terraso-client-shared/config';
import type { Severity } from 'terraso-client-shared/monitoring/logger';

import { rollbar } from 'monitoring/rollbar';

export const TERRASO_ENV = process.env.ENV || 'development';

export const TERRASO_API_URL =
Expand All @@ -36,8 +34,6 @@ export const COOKIES_DOMAIN =

const COOKIES_PARAMS = { path: '/', domain: COOKIES_DOMAIN };

export const ROLLBAR_TOKEN = process.env.REACT_APP_ROLLBAR_TOKEN;

export const SENTRY_DSN = process.env.SENTRY_DSN;

setAPIConfig({
Expand All @@ -50,7 +46,7 @@ setAPIConfig({
Cookies.set(name, token, COOKIES_PARAMS);
},
},
logger: (severity: Severity, ...args) => rollbar[severity](...args),
logger: (severity: Severity, ...args) => console.log(...args),
});

export const WAIT_FOR_TIMEOUT = process.env.REACT_APP_WAIT_FOR_TIMEOUT || 3000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import BaseDropZone from 'common/components/DropZone';
import ExternalLink from 'common/components/ExternalLink';
import InlineHelp from 'common/components/InlineHelp';
import PageHeader from 'layout/PageHeader';
import { rollbar } from 'monitoring/rollbar';
import { useMap } from 'gis/components/Map';
import { parseFileToGeoJSON } from 'gis/gisSlice';
import mapboxgl from 'gis/mapbox';
Expand Down Expand Up @@ -74,7 +73,7 @@ const DropZone = props => {
if (success) {
setCurrentFile(selectedFile);
} else {
rollbar.error(data.payload);
console.error(data.payload);
}
});
},
Expand Down
10 changes: 0 additions & 10 deletions src/monitoring/error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
import { render, screen } from 'tests/utils';
import React from 'react';

import { rollbar } from 'monitoring/rollbar';

jest.mock('monitoring/rollbar');

global.console.error = jest.fn();

const Bomb = () => {
Expand Down Expand Up @@ -53,12 +49,6 @@ test('ErrorMonitoringProvider: component error', async () => {
).toBe(true);
expect(console.error.mock.calls[3][0]).toStrictEqual('💥 CABOOM 💥');

// Rollbar
expect(rollbar.error).toHaveBeenCalledTimes(1);
const rollbarCall = rollbar.error.mock.calls[0];
expect(rollbarCall[0]).toStrictEqual('💥 CABOOM 💥');
expect(rollbarCall[1].startsWith('Error: 💥 CABOOM 💥')).toBe(true);

// Show error page
expect(
screen.getByText('Oops, something went wrong. Try again in a few minutes.')
Expand Down
29 changes: 0 additions & 29 deletions src/monitoring/rollbar.js

This file was deleted.

0 comments on commit 94651f6

Please sign in to comment.