Skip to content

Commit

Permalink
fix: condition remote sdp received timestamp updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Tham committed Jan 9, 2025
1 parent f306d42 commit b6baef7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
key === 'client.media.rx.start' ||
key === 'client.media.tx.start' ||
key === 'internal.client.meetinginfo.request' ||
key === 'internal.client.meetinginfo.response'
key === 'internal.client.meetinginfo.response' ||
key === 'client.media-engine.remote-sdp-received'
) {
this.saveFirstTimestampOnly(key, value);
} else {
this.latencyTimestamps.set(key, value);
// new offer/answer so reset the remote SDP timestamp
if (key === 'client.media-engine.local-sdp-generated') {
this.latencyTimestamps.delete('client.media-engine.remote-sdp-received');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ describe('internal-plugin-metrics', () => {
cdl.saveTimestamp({key: 'internal.client.meetinginfo.response', value: 20});
assert.deepEqual(saveFirstTimestamp.callCount, 1);
});

it('calls saveFirstTimestamp for remote SDP received', () => {
const saveFirstTimestamp = sinon.stub(cdl, 'saveFirstTimestampOnly');
cdl.saveTimestamp({key: 'client.media-engine.remote-sdp-received', value: 10});
assert.deepEqual(saveFirstTimestamp.callCount, 1);
});

it('clears timestamp for remote SDP received when local SDP generated', () => {
cdl.saveTimestamp({key: 'client.media-engine.remote-sdp-received', value: 10});
cdl.saveTimestamp({key: 'client.media-engine.local-sdp-generated', value: 20});
assert.isUndefined(cdl.latencyTimestamps.get('client.media-engine.remote-sdp-received'));
});
});

it('calculates getShowInterstitialTime correctly', () => {
Expand Down

0 comments on commit b6baef7

Please sign in to comment.