🧪(frontend) capture LiveKit exceptions in PostHog for debugging
Test tracking signaling failures to determine root causes when connection fails. Will remove if it spams analytics - goal is understanding failure patterns and reasons.
This commit is contained in:
committed by
aleb_the_flash
parent
031852d0b1
commit
224b98fd9a
@@ -18,12 +18,12 @@ import { ApiRoom } from '../api/ApiRoom'
|
|||||||
import { useCreateRoom } from '../api/createRoom'
|
import { useCreateRoom } from '../api/createRoom'
|
||||||
import { InviteDialog } from './InviteDialog'
|
import { InviteDialog } from './InviteDialog'
|
||||||
import { VideoConference } from '../livekit/prefabs/VideoConference'
|
import { VideoConference } from '../livekit/prefabs/VideoConference'
|
||||||
import posthog from 'posthog-js'
|
|
||||||
import { css } from '@/styled-system/css'
|
import { css } from '@/styled-system/css'
|
||||||
import { BackgroundProcessorFactory } from '../livekit/components/blur'
|
import { BackgroundProcessorFactory } from '../livekit/components/blur'
|
||||||
import { LocalUserChoices } from '@/stores/userChoices'
|
import { LocalUserChoices } from '@/stores/userChoices'
|
||||||
import { navigateTo } from '@/navigation/navigateTo'
|
import { navigateTo } from '@/navigation/navigateTo'
|
||||||
import { MediaDeviceErrorAlert } from './MediaDeviceErrorAlert'
|
import { MediaDeviceErrorAlert } from './MediaDeviceErrorAlert'
|
||||||
|
import { usePostHog } from 'posthog-js/react'
|
||||||
|
|
||||||
export const Conference = ({
|
export const Conference = ({
|
||||||
roomId,
|
roomId,
|
||||||
@@ -36,9 +36,11 @@ export const Conference = ({
|
|||||||
mode?: 'join' | 'create'
|
mode?: 'join' | 'create'
|
||||||
initialRoomData?: ApiRoom
|
initialRoomData?: ApiRoom
|
||||||
}) => {
|
}) => {
|
||||||
|
const posthog = usePostHog()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
posthog.capture('visit-room', { slug: roomId })
|
posthog.capture('visit-room', { slug: roomId })
|
||||||
}, [roomId])
|
}, [roomId, posthog])
|
||||||
const fetchKey = [keys.room, roomId]
|
const fetchKey = [keys.room, roomId]
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -138,6 +140,9 @@ export const Conference = ({
|
|||||||
className={css({
|
className={css({
|
||||||
backgroundColor: 'primaryDark.50 !important',
|
backgroundColor: 'primaryDark.50 !important',
|
||||||
})}
|
})}
|
||||||
|
onError={(e) => {
|
||||||
|
posthog.captureException(e)
|
||||||
|
}}
|
||||||
onDisconnected={(e) => {
|
onDisconnected={(e) => {
|
||||||
if (e == DisconnectReason.CLIENT_INITIATED) {
|
if (e == DisconnectReason.CLIENT_INITIATED) {
|
||||||
navigateTo('feedback', { duplicateIdentity: false })
|
navigateTo('feedback', { duplicateIdentity: false })
|
||||||
|
|||||||
Reference in New Issue
Block a user