Let otel know we're joining before trying to join

Otherwise it starts getting calls being created before the group call
span exists and we get call spans not associated with the group call
span.

(What 74b218af8c should have been)
This commit is contained in:
David Baker 2023-03-31 10:30:01 +01:00
parent 72403d1aea
commit 5e6c33b3b5

View File

@ -423,12 +423,14 @@ export function useGroupCall(
PosthogAnalytics.instance.eventCallEnded.cacheStartCall(new Date());
PosthogAnalytics.instance.eventCallStarted.track(groupCall.groupCallId);
// This must be called before we start trying to join the call, as we need to
// have started tracking by the time calls start getting created.
groupCallOTelMembership?.onJoinCall();
groupCall.enter().catch((error) => {
console.error(error);
updateState({ error });
});
groupCallOTelMembership?.onJoinCall();
}, [groupCall, updateState]);
const toggleLocalVideoMuted = useCallback(() => {