Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

♻️(frontend) prefer captureMediaEvent over reportError when no-op

lebaudantoineab40ec365dcf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84327113..df607e8c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ and this project adheres to
- ♻️(frontend) encapsulate PostHog capture calls in the telemetry module
- 🔧(frontend) sync persisted device ids with the actual selected devices
- 💄(frontend) hide the ProConnect button on narrow viewports
+- ♻️(frontend) prefer captureMediaEvent over reportError when no-op
### Fixed
diff --git a/src/frontend/src/features/analytics/telemetry.ts b/src/frontend/src/features/analytics/telemetry.ts
index 3a565fd9..b2d2adcf 100644
--- a/src/frontend/src/features/analytics/telemetry.ts
+++ b/src/frontend/src/features/analytics/telemetry.ts
@@ -134,7 +134,8 @@ export const captureMediaEvent = async (
| 'media-acquisition'
| 'media-device-topology'
| 'media-device-success'
- | 'device-not-found',
+ | 'device-not-found'
+ | 'permissions-denied',
props: Record<string, unknown>
) => {
captureEvent(event, { ...props, ...(await deviceSnapshot()) })
diff --git a/src/frontend/src/features/rooms/livekit/hooks/useJoinTracks.ts b/src/frontend/src/features/rooms/livekit/hooks/useJoinTracks.ts
index ea9b2c42..8c38967d 100644
--- a/src/frontend/src/features/rooms/livekit/hooks/useJoinTracks.ts
+++ b/src/frontend/src/features/rooms/livekit/hooks/useJoinTracks.ts
@@ -13,7 +13,7 @@ import {
notePermissionDeniedFromGum,
type PermissionKind,
} from '@/stores/permissions'
-import { reportError } from '@/features/analytics/telemetry'
+import { captureMediaEvent, reportError } from '@/features/analytics/telemetry'
import {
saveAudioInputDeviceId,
saveAudioInputEnabled,
@@ -39,12 +39,21 @@ const PERMISSION_KIND: Record<'audioinput' | 'videoinput', PermissionKind> = {
}
export const onJoinPreviewError = (e: Error, kind?: PermissionKind) => {
- reportError('join_preview_failure', e, { path: 'join_preview', kind })
if (
MediaDeviceFailure.getFailure(e) === MediaDeviceFailure.PermissionDenied
) {
notePermissionDeniedFromGum(kind)
+ captureMediaEvent('permissions-denied', { path: 'join_preview', kind })
+ return
+ }
+
+ if (MediaDeviceFailure.getFailure(e) === MediaDeviceFailure.NotFound) {
+ captureMediaEvent('device-not-found', { path: 'join_preview', kind })
+ return
}
+
+ // "Other" and "Device in use" are still reported as errors, as they are not handled on the join screen.
+ reportError('join_preview_failure', e, { path: 'join_preview', kind })
}
// Module-level: effect dependencies, must be referentially stable.