diff --git a/src/analytics/PosthogEvents.ts b/src/analytics/PosthogEvents.ts index f49a7553..0252c0aa 100644 --- a/src/analytics/PosthogEvents.ts +++ b/src/analytics/PosthogEvents.ts @@ -17,6 +17,7 @@ import { interface CallEnded extends IPosthogEvent { eventName: "CallEnded"; + // the callId posthog key is essentially a Matrix roomId callId: string; callParticipantsOnLeave: number; callParticipantsMax: number; @@ -120,6 +121,7 @@ export class CallEndedTracker { interface CallStarted extends IPosthogEvent { eventName: "CallStarted"; + // the callId posthog key is essentially a Matrix roomId callId: string; } @@ -180,6 +182,7 @@ export class LoginTracker { interface MuteMicrophone { eventName: "MuteMicrophone"; targetMuteState: "mute" | "unmute"; + // the callId posthog key is essentially a Matrix roomId callId: string; } @@ -196,6 +199,7 @@ export class MuteMicrophoneTracker { interface MuteCamera { eventName: "MuteCamera"; targetMuteState: "mute" | "unmute"; + // the callId posthog key is essentially a Matrix roomId callId: string; } @@ -211,6 +215,7 @@ export class MuteCameraTracker { interface UndecryptableToDeviceEvent { eventName: "UndecryptableToDeviceEvent"; + // the callId posthog key is essentially a Matrix roomId callId: string; } @@ -225,6 +230,7 @@ export class UndecryptableToDeviceEventTracker { interface QualitySurveyEvent { eventName: "QualitySurvey"; + // the callId posthog key is essentially a Matrix roomId callId: string; feedbackText: string; stars: number; @@ -298,6 +304,7 @@ export type CallReconnectingReason = interface CallReconnecting extends IPosthogEvent { eventName: "CallReconnecting"; + // the callId posthog key is essentially a Matrix roomId callId: string; reason: CallReconnectingReason; reconnectDuration: number; diff --git a/src/state/CallViewModel/CallViewModel.ts b/src/state/CallViewModel/CallViewModel.ts index 016b930f..07898b9e 100644 --- a/src/state/CallViewModel/CallViewModel.ts +++ b/src/state/CallViewModel/CallViewModel.ts @@ -560,7 +560,7 @@ export function createCallViewModel$( connectionManager, matrixRTCSession, localTransport$, - callId: matrixRoom.roomId, + roomId: matrixRoom.roomId, logger: logger.getChild(`[${Date.now()}]`), }); diff --git a/src/state/CallViewModel/localMember/LocalMember.test.ts b/src/state/CallViewModel/localMember/LocalMember.test.ts index 6b3be70d..25b7191e 100644 --- a/src/state/CallViewModel/localMember/LocalMember.test.ts +++ b/src/state/CallViewModel/localMember/LocalMember.test.ts @@ -231,7 +231,7 @@ describe("LocalMembership", () => { ]), rtsSession$: constant(RTCMemberStatus.Connected), }, - callId: "!test-room-id:example.org", + roomId: "!test-room-id:example.org", }; it("throws error on missing RTC config error", () => { @@ -772,7 +772,7 @@ describe("LocalMembership", () => { hsReason$.next([true, null]); expect(trackSpy).toHaveBeenCalledWith( - defaultCreateLocalMemberValues.callId, + defaultCreateLocalMemberValues.roomId, "sync", expect.any(Number), ); @@ -822,7 +822,7 @@ describe("LocalMembership", () => { connectionState$.next(ConnectionState.LivekitConnected); expect(trackSpy).toHaveBeenCalledWith( - defaultCreateLocalMemberValues.callId, + defaultCreateLocalMemberValues.roomId, "livekit", expect.any(Number), ); @@ -873,13 +873,13 @@ describe("LocalMembership", () => { expect(trackSpy).toHaveBeenCalledTimes(2); expect(trackSpy).toHaveBeenNthCalledWith( 1, - defaultCreateLocalMemberValues.callId, + defaultCreateLocalMemberValues.roomId, "membership", expect.any(Number), ); expect(trackSpy).toHaveBeenNthCalledWith( 2, - defaultCreateLocalMemberValues.callId, + defaultCreateLocalMemberValues.roomId, "probablyLeft", expect.any(Number), ); diff --git a/src/state/CallViewModel/localMember/LocalMember.ts b/src/state/CallViewModel/localMember/LocalMember.ts index 13a21a41..88f3da0a 100644 --- a/src/state/CallViewModel/localMember/LocalMember.ts +++ b/src/state/CallViewModel/localMember/LocalMember.ts @@ -128,7 +128,7 @@ interface Props { createPublisherFactory: (connection: Connection) => Publisher; joinMatrixRTC: (transport: LivekitTransportConfig) => void; homeserverConnected: HomeserverConnected; - callId: string; + roomId: string; localTransport$: Behavior; matrixRTCSession: Pick< MatrixRTCSession, @@ -152,7 +152,7 @@ interface Props { * @param props.logger The logger to use. * @param props.muteStates The mute states for video and audio. * @param props.matrixRTCSession The matrix RTC session to join. - * @param props.callId The room ID used as the call identifier in analytics events. + * @param props.roomId The room ID used as the call identifier in analytics events. * @returns * - publisher: The handle to create tracks and publish them to the room. * - connected$: the current connection state. Including matrix server and livekit server connection. (only considering the livekit server we are using for our own media publication) @@ -170,7 +170,7 @@ export const createLocalMembership$ = ({ logger: parentLogger, muteStates, matrixRTCSession, - callId, + roomId: roomId, }: Props): { /** * This request to start audio and video tracks. @@ -552,7 +552,7 @@ export const createLocalMembership$ = ({ } } else if (reconnectStart !== null) { PosthogAnalytics.instance.eventCallReconnecting.track( - callId, + roomId, reconnectStart.reason, (Date.now() - reconnectStart.time) / 1000, );