Merge pull request #1024 from vector-im/dbkr/otel_detect_call_changed

End spans when calls are replaced by a different call
This commit is contained in:
David Baker 2023-04-24 19:52:01 +01:00 committed by GitHub
commit 4ddf9ce29c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -210,7 +210,12 @@ export class OTelGroupCallMembership {
for (const callTrackingInfo of this.callsByCallId.values()) {
const userCalls = calls.get(callTrackingInfo.userId);
if (!userCalls || !userCalls.has(callTrackingInfo.deviceId)) {
if (
!userCalls ||
!userCalls.has(callTrackingInfo.deviceId) ||
userCalls.get(callTrackingInfo.deviceId).callId !==
callTrackingInfo.call.callId
) {
callTrackingInfo.span.end();
this.callsByCallId.delete(callTrackingInfo.call.callId);
}