feat: add Sentry error tracking with defensive error boundary

- Initialize Sentry SDK in index.tsx when VITE_SENTRY_DSN env var is set
- Wrap entire App with Sentry.ErrorBoundary (replaces the hard crash with a retry UI)
- 5% trace sample rate, sendDefaultPii disabled, strip events containing accessToken
- Add .env.production template with VITE_SENTRY_DSN placeholder
- Get your DSN from sentry.io -> Project Settings -> Client Keys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lotus Bot
2026-05-21 19:44:51 -04:00
parent c1249f3322
commit 41899adafa
5 changed files with 185 additions and 28 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
{
"name": "lotus-chat",
"version": "4.12.1-lotus",
"description": "Lotus Chat \u2014 Matrix client for Lotus Guild",
"description": "Lotus Chat Matrix client for Lotus Guild",
"main": "index.js",
"type": "module",
"engines": {
@@ -70,6 +70,7 @@
"@giphy/js-fetch-api": "5.8.0",
"@giphy/js-types": "5.1.0",
"@giphy/react-components": "10.1.2",
"@sentry/react": "10.53.1",
"@tanstack/react-query": "5.24.1",
"@tanstack/react-query-devtools": "5.24.1",
"@tanstack/react-virtual": "3.2.0",