Skip to content

feat(analytics): tag cloud transcriptions and report feature usage events#1121

Open
gabrielste1n wants to merge 1 commit into
mainfrom
feat/usage-analytics
Open

feat(analytics): tag cloud transcriptions and report feature usage events#1121
gabrielste1n wants to merge 1 commit into
mainfrom
feat/usage-analytics

Conversation

@gabrielste1n

Copy link
Copy Markdown
Collaborator

Desktop side of the workspace usage analytics feature (plan: admin-console-usage-analytics-page.md). Works with the openwhispr-api companion PR; fully backward-compatible with the currently-deployed API (new fields are additive and ignored by the old parser).

What's new

  • Feature tagging on cloud requests: /api/transcribe multipart gains feature (dictation/upload), audioDurationSeconds (inline requests), and per-chunk clientEventId (clientTranscriptionId:chunkIndex, retry-safe); /api/streaming-usage gains feature/clientEventId. Uploads deliberately do not transmit clientTranscriptionId (would flip deployed-server chunked uploads to last-chunk-wins quota accounting); the id base is passed out-of-band for event derivation only.
  • Meeting usage reporting (new — meetings were previously invisible to analytics in every mode): a per-session snapshot is minted at record start and reported once at stop with word count (seed-excluded for resumed recordings), wall-clock duration, and mode (cloud/byok/local). Cleared on every abort/failure path.
  • UsageReportingService (renderer, SyncService conventions): localStorage queue with cross-window Web-Lock serialization, batch flush (≤50) on enqueue/startup/interval, idempotent event ids. Gating: signed-in + managed workspace required for everything; local/BYOK events additionally require the admin's collectLocalUsage setting (from /api/stt-config, honored at enqueue and re-checked at flush so an admin turning collection off drops queued events instead of sending them). Offline/gate-fetch failures queue rather than drop; nothing is ever sent for free individual accounts.
  • Privacy disclosure (member-facing): static row in Settings → Privacy when workspace reporting is active — "Your workspace admin can see your word counts and feature usage — never transcript text or audio." Localized in all 10 languages; the existing anonymous-diagnostics toggle is untouched.
  • x-openwhispr-version header now sent on authenticated cloud calls (shared header builder) so the console's per-member coverage badges work.
  • Mode attribution fix: BYOK→local fallback transcriptions report as local.

Verification

npm run quality-check (eslint, prettier, tsc), check-i18n, and the test suite (194 pass / 0 fail) green. Wire-compat of every new field verified against the deployed API parser.

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.

1 participant