Remove sentry logging

This commit is contained in:
nthouliss 2022-11-28 15:42:12 +11:00
parent 17dfab8194
commit cd52d526e6
5 changed files with 2 additions and 85 deletions

View File

@ -3,7 +3,6 @@ import Vector3 from "./Vector3";
import Vector2 from "./Vector2"; import Vector2 from "./Vector2";
import Size from "./Size"; import Size from "./Size";
import { logError } from "./logging";
import { Grid, GridInset, GridScale } from "../types/Grid"; import { Grid, GridInset, GridScale } from "../types/Grid";
const SQRT3 = 1.73205; const SQRT3 = 1.73205;
@ -562,8 +561,8 @@ export async function getGridSizeFromImage(image: HTMLImageElement) {
try { try {
prediction = await gridSizeML(image, candidates); prediction = await gridSizeML(image, candidates);
} catch (error) { } catch (error) {
if (error instanceof Error) { if (error instanceof Error) {
logError(error); console.error(error);
} }
} }

View File

@ -1,8 +0,0 @@
import { captureException } from "@sentry/react";
export function logError(error: Error): void {
console.error(error);
if (process.env.REACT_APP_LOGGING === "true") {
captureException(error);
}
}

View File

@ -1,6 +1,4 @@
import ReactDOM from "react-dom"; import ReactDOM from "react-dom";
import * as Sentry from "@sentry/react";
import { Dedupe } from "@sentry/integrations";
import App from "./App"; import App from "./App";
import Modal from "react-modal"; import Modal from "react-modal";
@ -21,73 +19,6 @@ if (!("IntersectionObserver" in window)) {
import("intersection-observer"); import("intersection-observer");
} }
if (process.env.REACT_APP_LOGGING === "true") {
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
release: "owlbear-rodeo@" + process.env.REACT_APP_VERSION,
integrations: [new Dedupe()],
// Ignore resize error as it is triggered by going fullscreen on slower computers
// Ignore quota error
// Ignore XDR encoding failure bug in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1678243
// Ignore LastPass extension text error
// Ignore chrome extension error
// Ignore dexie error todo: fix
ignoreErrors: [
"ResizeObserver loop limit exceeded",
"ResizeObserver loop completed with undelivered notifications",
// Konva error with FireFox 78
"CanvasPattern.setTransform: Argument 1 does not implement interface SVGMatrix",
"QuotaExceededError",
"DatabaseClosedError",
"XDR encoding failure",
"Assertion failed: Input argument is not an HTMLInputElement",
"Extension context invalidated",
new RegExp(
"([InvalidStateError:\\s]*Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing([.]*[\\s]*))+"
),
"Browser is shutting down",
"An internal error was encountered in the Indexed Database server",
// Random plugins/extensions
"top.GLOBALS",
// See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
"originalCreateNotification",
"canvas.contentDocument",
"MyApp_RemoveAllHighlights",
"http://tt.epicplay.com",
"Can't find variable: ZiteReader",
"jigsaw is not defined",
"ComboSearch is not defined",
"http://loading.retry.widdit.com/",
"atomicFindClose",
// Facebook borked
"fb_xd_fragment",
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
// reduce this. (thanks @acdha)
// See http://stackoverflow.com/questions/4113268
"bmi_SafeAddOnload",
"EBCallBackMessageReceived",
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
"conduitPage",
],
denyUrls: [
// Facebook flakiness
/graph\.facebook\.com/i,
// Facebook blocked
/connect\.facebook\.net\/en_US\/all\.js/i,
// Woopra flakiness
/eatdifferent\.com\.woopra-ns\.com/i,
/static\.woopra\.com\/js\/woopra\.js/i,
// Chrome extensions
/extensions\//i,
/^chrome:\/\//i,
// Other plugins
/127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
/webappstoolbarba\.texthelp\.com\//i,
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
],
});
}
Modal.setAppElement("#root"); Modal.setAppElement("#root");
ReactDOM.render(<App />, document.getElementById("root")); ReactDOM.render(<App />, document.getElementById("root"));

View File

@ -5,7 +5,6 @@ import { EventEmitter } from "events";
import Connection, { DataProgressEvent } from "./Connection"; import Connection, { DataProgressEvent } from "./Connection";
import { omit } from "../helpers/shared"; import { omit } from "../helpers/shared";
import { logError } from "../helpers/logging";
import { SignalData } from "simple-peer"; import { SignalData } from "simple-peer";
/** /**
@ -95,7 +94,6 @@ class Session extends EventEmitter {
this.emit("status", "ready"); this.emit("status", "ready");
} catch (error: any) { } catch (error: any) {
logError(error);
this.emit("status", "offline"); this.emit("status", "offline");
} }
} }
@ -309,7 +307,6 @@ class Session extends EventEmitter {
return true; return true;
} catch (error: any) { } catch (error: any) {
logError(error);
this.emit("peerError", { error }); this.emit("peerError", { error });
for (let peer of Object.values(this.peers)) { for (let peer of Object.values(this.peers)) {
peer.connection && peer.connection.destroy(); peer.connection && peer.connection.destroy();

View File

@ -15,7 +15,6 @@ import Footer from "../components/Footer";
import ErrorBanner from "../components/banner/ErrorBanner"; import ErrorBanner from "../components/banner/ErrorBanner";
import LoadingOverlay from "../components/LoadingOverlay"; import LoadingOverlay from "../components/LoadingOverlay";
import { logError } from "../helpers/logging";
import { Stripe } from "@stripe/stripe-js"; import { Stripe } from "@stripe/stripe-js";
type Price = { price?: string; name: string; value: number }; type Price = { price?: string; name: string; value: number };
@ -45,7 +44,6 @@ function Donate() {
} }
}) })
.catch((error) => { .catch((error) => {
logError(error);
// TODO: check setError -> cannot work with value as a string // TODO: check setError -> cannot work with value as a string
setError(error.message); setError(error.message);
setLoading(false); setLoading(false);