Skip to content

Commit

Permalink
reset new issues
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Aug 21, 2024
1 parent ecf12f4 commit 10dfdd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observertc/observer-js",
"version": "0.42.3",
"version": "0.42.4",
"description": "Server Side NodeJS Library for processing ObserveRTC Samples",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
7 changes: 5 additions & 2 deletions src/ObservedClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class ObservedClient<AppData extends Record<string, unknown> = Record<str
public readonly mediaDevices: MediaDevice[] = [];
public readonly mediaCodecs: MediaCodecStats[] = [];
public readonly userMediaErrors: string[] = [];
public readonly issues: ClientIssue[] = [];
public issues: ClientIssue[] = [];

public ωpendingPeerConnectionTimestamps: PendingPeerConnectionTimestamp[] = [];
public ωpendingMediaTrackTimestamps: PendingMediaTrackTimestamp[] = [];
Expand Down Expand Up @@ -324,7 +324,10 @@ export class ObservedClient<AppData extends Record<string, unknown> = Record<str
const now = Date.now();

++this._acceptedSamples;

if (0 < this.issues.length) {
// we reset the issues every time we accept a new sample
this.issues = [];
}
for (const peerConnection of this._peerConnections.values()) {
if (peerConnection.closed) continue;
peerConnection.resetMetrics();
Expand Down
3 changes: 2 additions & 1 deletion src/monitors/CallSummaryMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export class CallSummaryMonitor extends EventEmitter {
clientSummary.totalDataChannelBytesReceived = client.totalDataChannelBytesReceived;
clientSummary.durationInMs = now - client.created;
clientSummary.left = now;
clientSummary.issues.push(...client.issues);
// client does not store issues after update emitted
// clientSummary.issues.push(...client.issues);

client.off('update', updateClient);
client.off('usingturn', onUsingTurn);
Expand Down

0 comments on commit 10dfdd2

Please sign in to comment.