Skip to content

Telemetry events without attached experiment context (microsoft/vscode-internalbacklog#6275)#277343

Merged
bpasero merged 1 commit intomainfrom
ben/amused-hamster
Nov 14, 2025
Merged

Telemetry events without attached experiment context (microsoft/vscode-internalbacklog#6275)#277343
bpasero merged 1 commit intomainfrom
ben/amused-hamster

Conversation

@bpasero
Copy link
Member

@bpasero bpasero commented Nov 14, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 14, 2025 06:19
@bpasero bpasero enabled auto-merge (squash) November 14, 2025 06:19
@bpasero bpasero self-assigned this Nov 14, 2025
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a workaround for an issue where telemetry events were being sent without attached experiment context (microsoft/vscode-internalbacklog#6275). The solution delays the logging of chat entitlement telemetry until the workbench reaches the Eventually lifecycle phase (2-5 seconds after startup).

Key Changes

  • Added ILifecycleService and LifecyclePhase imports to support lifecycle-based execution
  • Injected ILifecycleService as a constructor parameter
  • Added a delayed telemetry logging call that waits for LifecyclePhase.Eventually before sending chat entitlement events

this.lifecycleService.when(LifecyclePhase.Eventually).then(() => {
if (this.context?.hasValue) {
logChatEntitlements(this.context.value.state, this.configurationService, this.telemetryService);
}
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The promise returned by lifecycleService.when() should have error handling. If the promise rejects for any reason, it could result in an unhandled promise rejection. Consider adding a .catch() handler to gracefully handle any potential errors.

Suggested change
}
}
}).catch(error => {
this.logService.error('Error waiting for LifecyclePhase.Eventually in ChatEntitlementService:', error);

Copilot uses AI. Check for mistakes.
@lszomoru
Copy link
Member

@bpasero, PR build is 🔴

@bpasero bpasero merged commit 43a8cc8 into main Nov 14, 2025
43 of 45 checks passed
@bpasero bpasero deleted the ben/amused-hamster branch November 14, 2025 07:51
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants