diff --git a/.env.example b/.env.example
new file mode 100644
index 000000000..1cf181064
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,15 @@
+# Copy to .env.local to report to Sentry from local builds.
+# Read by the gui (vite), electron and server (gradle) builds. Real environment variables win.
+# Rebuild after changing it, the values are baked in at build time.
+
+# Forces a Sentry release. Without it only clean tagged builds report.
+# Source maps are never uploaded for a forced release.
+SENTRY_RELEASE=v0.0.0-local
+
+# Keeps local events out of production alerts and release health. Defaults to production.
+SENTRY_ENVIRONMENT=development
+
+# Leave a DSN empty to disable that part.
+SENTRY_GUI_DSN=
+SENTRY_ELECTRON_DSN=
+SENTRY_SERVER_DSN=
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 86ecd1214..791d7949e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -121,6 +121,8 @@ jobs:
uses: gradle/actions/setup-gradle@v6
- name: Build ShadowJar
run: ./gradlew :server:desktop:shadowJar --build-cache
+ env:
+ SENTRY_SERVER_DSN: ${{ vars.SENTRY_SERVER_DSN }}
- name: Test with Gradle
run: ./gradlew :server:core:jvmTest
- name: Upload Server Jar
@@ -151,6 +153,9 @@ jobs:
- name: Build JS
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
+ SENTRY_GUI_DSN: ${{ vars.SENTRY_GUI_DSN }}
+ SENTRY_ELECTRON_DSN: ${{ vars.SENTRY_ELECTRON_DSN }}
+ SENTRY_SERVER_DSN: ${{ vars.SENTRY_SERVER_DSN }}
run: pnpm i && pnpm run build
- name: Tar GUI Dist
run: tar -czf slimevr-gui-dist.tar.gz -C gui/electron/out .
@@ -201,8 +206,6 @@ jobs:
run: mkdir -p gui/electron/out && tar -xzf slimevr-gui-dist.tar.gz -C gui/electron/out
- name: Run Electron Builder
shell: bash
- env:
- SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
mkdir -p gui/electron/dist/artifacts/linux/ \
gui/electron/dist/artifacts/win \
@@ -275,6 +278,8 @@ jobs:
- name: Build APK
run: ./gradlew :server:android:build --build-cache
env:
+ SENTRY_SERVER_DSN: ${{ vars.SENTRY_SERVER_DSN }}
+ SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
ANDROID_STORE_FILE: ${{ secrets.ANDROID_STORE_FILE }}
ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_STORE_PASSWD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
@@ -291,6 +296,8 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew :server:android:bundleRelease
env:
+ SENTRY_SERVER_DSN: ${{ vars.SENTRY_SERVER_DSN }}
+ SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
ANDROID_STORE_FILE: ${{ secrets.ANDROID_GPLAY_STORE_FILE }}
ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_GPLAY_STORE_PASSWD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_GPLAY_KEY_ALIAS }}
diff --git a/.gitignore b/.gitignore
index bafcec069..979c7715f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,3 +57,5 @@ vrconfig.yml.tmp
# Nixos
.bin/
+
+.env.local
diff --git a/gradle.properties b/gradle.properties
index b697460b9..e3bbd8942 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -25,3 +25,6 @@ spotlessVersion=8.2.1
shadowJarVersion=9.3.1
buildconfigVersion=6.0.7
wireVersion=5.3.1
+# sentry and sentry-android-core must stay on the same version
+sentryVersion=8.+
+sentryAndroidGradleVersion=6.23.0
diff --git a/gui/app/public/i18n/en/translation.ftl b/gui/app/public/i18n/en/translation.ftl
index e49af207c..5da9f29b1 100644
--- a/gui/app/public/i18n/en/translation.ftl
+++ b/gui/app/public/i18n/en/translation.ftl
@@ -733,11 +733,18 @@ settings-general-interface-discord_presence-message = { $amount ->
}
settings-interface-behavior-error_tracking = Error collection via Sentry.io
settings-interface-behavior-error_tracking-description_v2 =
-
Do you consent to the collection of anonymized error data?
+
Do you consent to the collection of error and diagnostic data?
We do not collect personal information such as your IP address or wireless credentials. SlimeVR values your privacy!
- To provide the best user experience, we collect anonymized error reports, performance metrics, and operating system information. This helps us detect bugs and issues with SlimeVR. These metrics are collected via Sentry.io.
+ To provide the best user experience, we collect:
+ - Error reports and performance metrics
+ - Operating system and tracker hardware information
+ - Recordings of the SlimeVR interface (text fields are hidden)
+ - Which features you use
+ - Your body proportions, to help us improve automatic proportions
+
+ This data is linked to a random ID, not to your identity, and helps us detect bugs and issues with SlimeVR. It is collected via Sentry.io.
settings-interface-behavior-error_tracking-label = Send errors to developers
settings-interface-behavior-bvh_directory = Directory to save BVH recordings
@@ -1603,6 +1610,13 @@ error_collection_modal-description_v2 = { settings-interface-behavior-error_trac
error_collection_modal-confirm = I agree
error_collection_modal-cancel = I don't want to
+## Crash screen
+crash_screen-title = Something went wrong
+crash_screen-description = The interface crashed. Reloading usually fixes it. If you report this issue, include the error id below.
+crash_screen-event_id = Error id: { $id }
+crash_screen-copy = Copy error id
+crash_screen-reload = Reload
+
## Tracking checklist section
tracking_checklist = Tracking Checklist
tracking_checklist-settings = Tracking Checklist Settings
diff --git a/gui/app/src/App.tsx b/gui/app/src/App.tsx
index 82b650f17..b123ffe20 100644
--- a/gui/app/src/App.tsx
+++ b/gui/app/src/App.tsx
@@ -18,7 +18,6 @@ import { ManualProportionsPage } from './components/onboarding/pages/body-propor
import { ConnectTrackersPage } from './components/onboarding/pages/connect-trackers/ConnectTrackers';
import { AddTrackersPage } from './components/onboarding/pages/AddTrackers';
import { HomePage } from './components/onboarding/pages/Home';
-import { ErrorCollectingConsentPage } from './components/onboarding/pages/ErrorCollectingConsent';
import { AutomaticMountingPage } from './components/onboarding/pages/mounting/AutomaticMounting';
import { ManualMountingPage } from './components/onboarding/pages/mounting/ManualMounting';
import { TrackersAssignPage } from './components/onboarding/pages/trackers-assign/TrackerAssignment';
@@ -45,7 +44,8 @@ import { UnknownDeviceModal } from './components/UnknownDeviceModal';
import { useDiscordPresence } from './hooks/discord-presence';
import { useControllerNav } from './hooks/controller-nav';
import { useInternalLinkGuard } from './hooks/internal-links';
-import { withSentryReactRouterV6Routing } from '@sentry/react';
+import * as Sentry from '@sentry/react';
+import { CrashScreen } from './components/CrashScreen';
import { ScaledProportionsPage } from './components/onboarding/pages/body-proportions/ScaledProportions';
import { AdvancedSettings } from './components/settings/pages/AdvancedSettings';
import { KeybindSettings } from './components/settings/pages/KeybindSettings';
@@ -64,27 +64,52 @@ import { ElectronContextC, provideElectron } from './hooks/electron';
import { AppLocalizationProvider } from './i18n/config';
import { openUrl } from './hooks/crossplatform';
import { UdevRulesModal } from './components/onboarding/UdevRulesModal';
+import { ErrorReportingConsentPage } from './components/ErrorReportingConsent';
+import {
+ AppStatusGate,
+ CONNECTING_PATH,
+ ERROR_REPORTING_CONSENT_PATH,
+} from './components/AppStatusGate';
+import { useProvideErrorReporting } from './hooks/error-reporting';
export const GH_REPO = 'SlimeVR/SlimeVR-Server';
export const VersionContext = createContext('');
export const DOCS_SITE = 'https://docs.slimevr.dev';
export const SLIMEVR_DISCORD = 'https://discord.gg/slimevr';
-const SentryRoutes = withSentryReactRouterV6Routing(Routes);
+const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes);
-function Layout() {
+function ConnectedApp() {
+ return (
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+function AppRoutes() {
const { isMobile } = useBreakpoint('mobile');
+ useProvideErrorReporting();
useDiscordPresence();
useControllerNav();
useInternalLinkGuard();
return (
- <>
-
-
-
-
- }>
+
+ }>
+ } />
+ }
+ />
+ }>
} />
- }
- />
} />
} />
} />
@@ -195,8 +216,8 @@ function Layout() {
} />
-
- >
+
+
);
}
@@ -294,25 +315,22 @@ export default function App() {
return (
-
-
-
-
-
-
-
-