Repository navigation
feat: mobile product telemetry and PostHog experimentation - #15883
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
summersmile1984
added a commit
to summersmile1984/omi
that referenced
this pull request
Sep 27, 2026
… re-record eleven owners Review of bf7f4f6..8d1f8e2 per owner, then re-record. Where upstream's change was semantic for the staged artifact the fork replacement moved with it — re-recording alone would have shipped upstream identity behavior: - AndroidManifest.xml (BasedHardware#14296, BasedHardware#5221): FOREGROUND_SERVICE_DATA_SYNC, foregroundServiceType shortService and the sync keep-alive service. No package, permission-identity or intent change; the new service name is already absolute, so native_android()'s namespace pass is untouched. - main.dart (BasedHardware#15956, BasedHardware#15883, BasedHardware#19157): startup moved behind PhysicalQualification.startupStage. _init is replaced wholesale by the stage anyway; the two crash fallbacks became "if (!PhysicalQualification.enabled && Firebase.apps.isNotEmpty) { unawaited(FirebaseCrashlytics...catchError(...)) }" so their reviewed replacement regex moved to that shape and still yields a Firebase-free Logger.debug fallback. - auth_service.dart (SCA-486/SCA-488): the token gateway gained a debug-only harness seam, so _tokenGateway is non-final — the stage strips the seam and keeps the field final; isSignedIn now routes through the gateway (the stage replaces its body, and NativeIdentity has no anonymous principal, so the reviewed semantics hold); a transient refresh failure now schedules _scheduleLocalDevRecovery, an Auth-emulator re-mint that cannot exist in a Firebase-free stage, so the kept refreshIdToken loses that call and keeps its reviewed retry-on-the-next-request behavior. - change_name_widget.dart / name_widget.dart (BasedHardware#18436): both collapsed into _save()/_submit(). The replacements were re-anchored so the staged app still awaits updateGivenName before success or advancing, still ships the identity_name_edit / identity_name_error keys gateway_test taps, and still never writes given/family name itself — only the auth-provider projection does. The dialog error moved into the content column the rewrite left behind. - settings: BasedHardware#18618/BasedHardware#18723 extracted the confirmed sign-out out of settings_drawer.dart into lib/pages/settings/sign_out.dart (now clearing through clearPreferencesForSignOut so device preferences survive). The completeNativeSignOut transaction owner moved with it — one owner instead of two — and sign_out.dart enters the registry as a reviewed input. - wrapper.dart: onboarding was restructured and gained a "Use a Different Account" path; both firebase_auth anchors (the import and the three FirebaseAuth.instance.currentUser! calls) still hold, and the staged AuthService.signOut still revokes remotely before the secure credential is cleared. - logger.dart / platform_manager.dart / platform_service.dart / crashlytics_manager.dart: PhysicalQualification gates. The stage still replaces the three reviewed members with the fork's false/no-op bodies and still overlays crashlytics_manager wholesale. - New upstream file lib/env/physical_qualification.dart reads Env.firebaseAuthEmulatorHost/firebaseAuthEmulatorPort, which the fork's env overlay did not expose: both are added there as compile-time inputs (the lane is iOS dev/local_dev only and never enabled in this artifact). Re-record: sha256 of the eleven stale paths plus the new sign_out.dart owner written into app/fork/source-owners.json, base moved to the reviewed tree. Verification: bash app/fork/test.sh exit 0 with the pinned Flutter 3.44.5 — test_stage.py 5/5, both targets staged, 20/20 staged Dart tests per target including gateway_test's failed-name-save contract, and flutter build bundle for both targets. python3 scripts/fork/check-overlay-owners.py exit 0. Failure-Class: none
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.
What changed and why
Closes #15746. Omi mobile now records correlated user-visible journey outcomes, useful actions, explicit satisfaction feedback and measurement health so product decisions can distinguish failed, empty, cancelled and unobserved work. Backend-owned feedback receipts and billing transitions feed a versioned scorecard and agent evidence packets with cohort completeness and uncertainty.
The same PR adds PostHog experiment infrastructure for small features and entire pages: typed variant registration, rendered exposure, sticky leases, identity/consent isolation, TTL and kill switches, QA exclusion, metric contracts and a create-only inactive-draft provisioner. The API contract and its generated Swift/TypeScript clients are updated together. A summary-feedback layout seam demonstrates the integration; the draft is inactive and the global gate defaults off.
Product invariants affected
INV-DATA-1: telemetry contains bounded metadata and opaque references; user content stays out of product analytics. Feedback ownership and immutable retry keys are checked server-side; persistence receipts are authoritative.
INV-UI-1: existing presentation remains the default; variant loading is noninteractive, exposure is visibility-gated, and whole-page variants preserve shared navigation/provider state. No memory, privacy, billing authority or account routing is controlled by experiments.
How it was verified
Production ingestion, real billing exports, live experiment allocation, physical-device battery/capture and customer uplift were not measured. The agent workflow emits evidence and proposed actions; it does not publish changes. No experiment was provisioned or launched, and no production Omi API was contacted.
Tests
Regression coverage verifies empty-vs-error search, stale request isolation, queue retry identity and SDK readiness, feedback persistence/replay/ownership, paid-entitlement transitions, exposure-only attribution and declared metric filters, mature retention/churn denominators, and synthetic regression/correction evidence packets. Component guides:
app/docs/product-telemetry/README.md,app/docs/experiments/README.md,docs/product-telemetry/README.md.Failure class
Failure-Class: none
Bounded additions to existing owners
New experiment, scoring, feedback and telemetry helpers live in separate modules. These existing lifecycle owners retain the identity, viewport, persistence and callback boundaries needed to make the observations authoritative; the explicit allowances below keep that growth visible to review.
Line-Count-Exception: app/lib/pages/chat/page.dart | 1678 -> 1692 | Wire actual message viewport visibility to the separate correlated chat telemetry owner.
Line-Count-Exception: app/lib/pages/conversation_detail/page.dart | 2200 -> 2245 | Record result visibility after paint with route, conversation and identity fences at the existing page lifecycle.
Line-Count-Exception: app/lib/providers/conversation_provider.dart | 1869 -> 1962 | Preserve the existing search owner while adding typed outcomes and stale request and pagination rejection.
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 3114 -> 3124 | Attach bounded observations to the existing audio, socket and transcript callbacks; aggregation stays in its helper.
Line-Count-Exception: app/lib/utils/analytics/analytics_manager.dart | 2411 -> 2716 | Keep serialized identity, consent, recoverable initialization and acknowledged queue handoff at the single SDK owner while new typed journeys and experiment evaluation live in separate modules.
Line-Count-Exception: backend/database/users.py | 2353 -> 2356 | Add optional build provenance to the existing chat feedback writer without changing its persistence authority.
Line-Count-Exception: backend/routers/chat.py | 2234 -> 2242 | Pass mobile version and build headers through the existing feedback route to the ledger.
Line-Count-Exception: backend/routers/payment.py | 1564 -> 1612 | Project billing transitions after existing subscription reconciliation and durable persistence; the event helper remains separate.
Line-Count-Exception: backend/routers/users.py | 2436 -> 2451 | Preserve the obsolete summary-rating no-op and add release provenance to active feedback routes.