chore: remove Sentry.io entirely
We no longer use Sentry. Removed: - @sentry/react + @sentry/vite-plugin (package.json + lockfile) - Sentry.init in index.tsx and the VITE_SENTRY_DSN env (.env.production) - @sentry/vite-plugin + the SENTRY_AUTH_TOKEN sourcemap-upload path in vite.config.js (sourcemap now always false) and the CI env var - Sentry.ErrorBoundary in App.tsx -> react-error-boundary's ErrorBoundary with a folds-native fallback (Box/Text/Button + config tokens), which also resolves the native-cinny audit's raw-#hex/#5865f2 fallback finding. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+29
-36
@@ -1,7 +1,16 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import * as Sentry from '@sentry/react';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
import { Provider as JotaiProvider, useAtomValue } from 'jotai';
|
||||
import { OverlayContainerProvider, PopOutContainerProvider, TooltipContainerProvider } from 'folds';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
config,
|
||||
OverlayContainerProvider,
|
||||
PopOutContainerProvider,
|
||||
Text,
|
||||
toRem,
|
||||
TooltipContainerProvider,
|
||||
} from 'folds';
|
||||
import { RouterProvider } from 'react-router-dom';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
||||
@@ -102,41 +111,25 @@ function App() {
|
||||
const portalContainer = document.getElementById('portalContainer') ?? undefined;
|
||||
|
||||
return (
|
||||
<Sentry.ErrorBoundary
|
||||
fallback={({ error, resetError }) => (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
height: '100vh',
|
||||
gap: '16px',
|
||||
fontFamily: 'sans-serif',
|
||||
padding: '24px',
|
||||
textAlign: 'center',
|
||||
}}
|
||||
<ErrorBoundary
|
||||
fallbackRender={({ error, resetErrorBoundary }) => (
|
||||
<Box
|
||||
direction="Column"
|
||||
alignItems="Center"
|
||||
justifyContent="Center"
|
||||
gap="400"
|
||||
style={{ height: '100vh', padding: config.space.S700, textAlign: 'center' }}
|
||||
>
|
||||
<h2 style={{ margin: 0 }}>Something went wrong</h2>
|
||||
<p style={{ margin: 0, color: '#666', maxWidth: '400px' }}>
|
||||
<Text size="H2">Something went wrong</Text>
|
||||
<Text size="T300" priority="300" style={{ maxWidth: toRem(400) }}>
|
||||
{error instanceof Error ? error.message : 'An unexpected error occurred.'}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={resetError}
|
||||
style={{
|
||||
padding: '8px 20px',
|
||||
borderRadius: '6px',
|
||||
border: 'none',
|
||||
background: '#5865f2',
|
||||
color: '#fff',
|
||||
cursor: 'pointer',
|
||||
fontSize: '14px',
|
||||
}}
|
||||
>
|
||||
Try again
|
||||
</button>
|
||||
</div>
|
||||
</Text>
|
||||
<Button variant="Primary" onClick={resetErrorBoundary}>
|
||||
<Text as="span" size="B400">
|
||||
Try again
|
||||
</Text>
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
>
|
||||
<TooltipContainerProvider value={portalContainer}>
|
||||
@@ -171,7 +164,7 @@ function App() {
|
||||
</OverlayContainerProvider>
|
||||
</PopOutContainerProvider>
|
||||
</TooltipContainerProvider>
|
||||
</Sentry.ErrorBoundary>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* eslint-disable import/first */
|
||||
import * as Sentry from '@sentry/react';
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { enableMapSet } from 'immer';
|
||||
@@ -7,31 +6,6 @@ import '@fontsource-variable/inter/index.css';
|
||||
import 'folds/dist/style.css';
|
||||
import { configClass, varsClass } from 'folds';
|
||||
|
||||
const sentryDsn = import.meta.env.VITE_SENTRY_DSN;
|
||||
if (sentryDsn) {
|
||||
Sentry.init({
|
||||
dsn: sentryDsn,
|
||||
environment: import.meta.env.MODE,
|
||||
release: import.meta.env.VITE_APP_VERSION,
|
||||
// browserTracingIntegration omitted — it injects sentry-trace/baggage headers
|
||||
// into outgoing fetch calls, which breaks Synapse CORS on matrix.lotusguild.org
|
||||
// No propagation targets — we don't control the Matrix server's CORS allow-list
|
||||
tracePropagationTargets: [],
|
||||
tracesSampleRate: 0,
|
||||
// Don't send PII (IPs, usernames) — this is a private chat app
|
||||
sendDefaultPii: false,
|
||||
// Forward Sentry logs to the dashboard
|
||||
enableLogs: true,
|
||||
// Suppress benign PostmessageTransport / matrixRTC heartbeat timeouts (upstream library noise)
|
||||
ignoreErrors: ['Request timed out'],
|
||||
beforeSend(event) {
|
||||
// Drop any event that may have leaked an access token into breadcrumbs/data
|
||||
if (JSON.stringify(event).includes('access_token')) return null;
|
||||
return event;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
enableMapSet();
|
||||
|
||||
import './index.css';
|
||||
|
||||
Reference in New Issue
Block a user