Skip to content

Commit

Permalink
Delete messages after being handled.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanscr committed Sep 13, 2024
1 parent fb55c2c commit 96393da
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/teams-js/src/internal/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ export class HostToAppMessageDelayTelemetry {
HostToAppMessageDelayTelemetry.callbackInformation.clear();
}

/**
* @internal
* Limited to Microsoft-internal use
*/
public static deleteMessageInformation(callbackId: MessageUUID): void {
HostToAppMessageDelayTelemetry.callbackInformation.delete(callbackId);
}

/**
* @internal
* Limited to Microsoft-internal use
Expand All @@ -104,6 +112,7 @@ export class HostToAppMessageDelayTelemetry {
messageDelay: getCurrentTimestamp() - message.timestamp,
messageWasCreatedAt: callbackInformation.calledAt,
});
HostToAppMessageDelayTelemetry.deleteMessageInformation(callbackID);
} else {
logger('Unable to send performance metrics for callback %i with arguments %o', callbackID, message.args);
}
Expand Down

0 comments on commit 96393da

Please sign in to comment.