📈(frontend) track errors when starting or stopping a recording

Send an analytics event whenever starting or stopping a recording
fails, so we can monitor how often it happens.

It also gives support the context needed to understand what went
wrong when inspecting a user's session.
This commit is contained in:
lebaudantoine
2026-08-21 15:09:57 +02:00
committed by aleb_the_flash
parent 15ca2b41b4
commit 52e5d99e83
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -8,6 +8,10 @@ and this project adheres to
## [Unreleased]
### Added
- 📈(frontend) track errors when starting or stopping a recording
### Changed
- ✨(backend) accept form-urlencoded on the user token endpoint
@@ -1,17 +1,20 @@
import { useStartRecording, useStopRecording } from '@/features/recording'
import { recordingStore } from '@/stores/recording'
import { captureEvent } from '@/features/analytics/telemetry'
export const useMutateRecording = () => {
const { mutateAsync: startRecording, isPending: isPendingToStart } =
useStartRecording({
onError: () => {
recordingStore.isErrorDialogOpen = 'start'
captureEvent('error-starting-recording')
},
})
const { mutateAsync: stopRecording, isPending: isPendingToStop } =
useStopRecording({
onError: () => {
recordingStore.isErrorDialogOpen = 'stop'
captureEvent('error-stopping-recording')
},
})