Skip to content

chore: improve java upgrade telemetry tracking and extension installation flow#1030

Open
frankliu20 wants to merge 6 commits into
microsoft:mainfrom
frankliu20:haital-microsoft/fix-upgrade-notification-telemetry
Open

chore: improve java upgrade telemetry tracking and extension installation flow#1030
frankliu20 wants to merge 6 commits into
microsoft:mainfrom
frankliu20:haital-microsoft/fix-upgrade-notification-telemetry

Conversation

@frankliu20

@frankliu20 frankliu20 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Why

Production telemetry from vscode-java-dependency v0.27.5 (7d) surfaced gaps in the
upgrade notification -> upgradeFlow funnel (follow-up to #1022, which already cut the
original "command not found" error rate from 23.2% to 0.5%):

  • The upgradeNotification.show event could not be split by CVE vs upgrade, so
    per-bucket click rates were diluted at the NOTIFY level.
  • 41% of not-installed flow starts were classified as activation-timeout, but 0 of
    those carried an install error. The post-install check was the problem, not the install:
    installExtension resolves on install completion, while the code then immediately
    re-read getExtensionState() and a fixed setTimeout(2000) before the extension had
    finished registering, so a healthy install was frequently mislabeled as a timeout.

What changed

1. Split NOTIFY by CVE vs upgrade (notificationManager.ts)
Add a source field (SOURCE_CVE / SOURCE_JAVA_UPGRADE) to the
upgradeNotification.show event, reusing the same constants the click handler already
passes to the upgrade command so NOTIFY and downstream funnel stages align on one dimension.

2. Record install completion as a step on the existing result event (utility.ts)
Emit install success right after installExtension resolves, but without a new business
operationName: it reuses the stable java.dependency.upgradeFlow.result event with an
upgradeFlowStep: "installSucceeded" dimension, plus installType ("installed" for a
fresh install, "updated" for an outdated one). installType is derived from the
pre-install state, so it stays unambiguous and avoids an unreliable post-install state
recompute.

3. Replace the unreliable activation wait with event-driven readiness (utility.ts)
On the not-installed path, drop the getExtensionState() re-check that produced the false
activation-timeout. A new waitForExtensionReady() helper resolves immediately if the
extension is already registered, otherwise listens on extensions.onDidChange and proceeds
as soon as it appears, with a 5s timeout fallback. The flow then reports
result: "proceeded" and returns true.

The upgrade flow no longer calls checkOrPromptToEnableAppModExtension(): getExtension()
returns undefined both when an extension is disabled and when it is freshly installed but
not yet activated, so the "seems disabled, enable it manually" prompt was misleading right
after a successful install. The helper is unchanged and still used by the modernization flow.

@frankliu20 frankliu20 marked this pull request as draft June 9, 2026 05:13
@frankliu20 frankliu20 force-pushed the haital-microsoft/fix-upgrade-notification-telemetry branch 5 times, most recently from faf0be4 to 447c880 Compare June 9, 2026 05:45
@frankliu20 frankliu20 marked this pull request as ready for review June 9, 2026 05:48
@frankliu20 frankliu20 changed the title chore: fix upgrade notification telemetry chore: improve java upgrade telemetry tracking and activation Jun 9, 2026
@frankliu20 frankliu20 force-pushed the haital-microsoft/fix-upgrade-notification-telemetry branch from 27162b6 to 5eeef91 Compare June 9, 2026 05:57
Follow-up to v0.27.5 telemetry analysis
(devdiv-azure-service-dmitryr/azure-java-migration-copilot-vscode-extension#5979):

- Add a source field (SOURCE_CVE / SOURCE_JAVA_UPGRADE) to the
  upgradeNotification.show event so NOTIFY-level data can be split by
  CVE vs upgrade and aligned with downstream funnel stages.
- Emit an installSucceeded event (with the initial extensionState, so
  fresh installs and updates can be told apart) right after
  installExtension resolves.
- Drop the post-install getExtensionState re-check that produced false
  activation-timeout results; the not-installed path now reports
  proceeded and returns true after install completes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@frankliu20 frankliu20 force-pushed the haital-microsoft/fix-upgrade-notification-telemetry branch from 5eeef91 to a3b367f Compare June 9, 2026 05:58
@wenytang-ms wenytang-ms requested a review from Copilot June 9, 2026 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refines the Java upgrade notification → upgradeFlow telemetry funnel to improve attribution and reduce false “activation-timeout” outcomes observed in production telemetry.

Changes:

  • Adds a NOTIFY-level source dimension (SOURCE_CVE vs SOURCE_JAVA_UPGRADE) to upgradeNotification.show telemetry.
  • Emits a new upgradeFlow.installSucceeded telemetry event immediately after installExtension resolves.
  • Simplifies the not-installed upgrade path to proceed after install (removing the post-install getExtensionState() re-check).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/upgrade/utility.ts Adds post-install telemetry and changes the post-install proceed/return behavior in the upgrade flow.
src/upgrade/display/notificationManager.ts Adds a source dimension to the upgrade notification “show” telemetry event.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/upgrade/utility.ts
Comment thread src/upgrade/utility.ts Outdated
FrankLiu4138 and others added 2 commits June 9, 2026 17:31
Address review: avoid adding a new business operationName for the
install step. Install success is already implied by the subsequent
upgradeFlow.result event under the same operation ID.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review: instead of a dedicated installSucceeded operationName,
reuse the stable java.dependency.upgradeFlow.result event and mark the
install step with an upgradeFlowStep dimension (plus extensionState so
fresh installs and updates can be told apart). Easier to query and evolve.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@frankliu20 frankliu20 requested a review from Copilot June 9, 2026 09:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread src/upgrade/utility.ts Outdated
Comment thread src/upgrade/utility.ts
FrankLiu4138 and others added 3 commits June 9, 2026 17:48
Address review: extensionState was the pre-install value, so tagging a
'succeeded' event with 'not-installed'/'outdated' was contradictory.
Replace it with installType ('installed' vs 'updated') derived from the
pre-install state, which is unambiguous and avoids an unreliable
post-install state recompute (the original activation-race bug).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
extensions.getExtension() returns undefined both when the extension is
disabled and when it is freshly installed but not yet activated, so the
'seems disabled, enable it manually' prompt is misleading right after a
successful install. Skip it on the upgrade path; the function and the
modernization caller are left unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the fixed 2s wait after a fresh install with an event-driven
wait: resolve immediately if the extension is already registered,
otherwise listen on extensions.onDidChange and proceed as soon as it
appears, with a 5s timeout fallback. Returns as early as possible while
still bounding the wait.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@frankliu20 frankliu20 changed the title chore: improve java upgrade telemetry tracking and activation chore: improve java upgrade telemetry tracking and extension installation flow Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants