fix(usage): deliver CLI telemetry without next-day return - #5271
Open
huangruiteng wants to merge 2 commits into
Open
huangruiteng wants to merge 2 commits into
huangruiteng wants to merge 2 commits into
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLI telemetry previously depended on a later UTC-day invocation, so a short-lived installation could report its heartbeat but never deliver any command results. This change attempts the first measured result immediately and sends subsequent buffered deltas on eligible activity at least 15 minutes apart, including across midnight.
The existing TypeScript usage-statistics owner retains consent, opt-outs, local locking and the identifier-free aggregate payload. Heartbeat and aggregate claims start their requests under the same short lock after persistence; network waits stay outside it. Existing daily buffers remain readable. No collector migration or new configuration is required. App Device defaults and the English/Chinese documentation explain the new cadence; Goal-duration snapshots retain their daily schedule.
Validation:
Tradeoff: this is still lossy, activity-triggered diagnostics. Quiet sessions can leave an unsent tail, failed batches are not retried, and aggregate receipt dates/versions cannot be joined to installation counts. Active installations may send up to one batch per 15 minutes instead of one per day; more frequent requests can expose more network timing correlation. Payload fields and recipient authority are unchanged.
Future-facing pass: reused the existing typed owner and locking seam, removed the aggregate dependency on the daily heartbeat claim, and added no parallel sender, scheduler, version dimension or identity field.
This changes runtime behavior and is left for maintainer review and merge. It does not update installed clients or deploy a release.