Repository navigation
SCA-4753: fleet offline-sync backlog snapshot (Phase 1) - #26683
Git-on-my-level wants to merge 3 commits into
Conversation
Server: registry families for the hourly backlog snapshot (seconds waiting on the Omi, on the phone, awaiting settlement, and oldest ages) and the pendant ring measures, with a closed SCA-4532 cohort label, mobile-only platforms, and per-build rollups for regression tracking. Build bands use per-platform floors and a per-process cap instead of the Phase 0 allowlist, which matched none of the builds phones sent. Backend GMP sample cap 15,000 -> 20,000: backend already peaked at 14,397 and over the cap GMP drops the whole instance scrape. App: one snapshot per installation per UTC hour on POST /v1/telemetry/fleet, numbers and closed labels only, analytics opt-out honored, beta pilot with remote stop flag mobile-fleet-backlog-telemetry. Ring numbers come from fresh INFO readings only. Dashboard: Phase 1 panels in the Omi Core Features backlog row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6b080d70e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _fleetInventoryLoaded = true; | ||
| _phoneBacklogPresent = SyncPipelineAmounts.fromPending(derivedWals.pendingWork).waitingOnPhoneSeconds > 0; | ||
| if (_fleetAttached) unawaited(FleetBacklogTelemetry.instance.maybeSend()); |
There was a problem hiding this comment.
Wait for WAL readiness before consuming the first snapshot
On a cold start where disk recovery is still running, _refreshWals() can finish with an empty inventory: LocalWalSyncImpl.getAllWals() returns the current in-memory list without awaiting walReady. The readiness wait occurs later in _attachTransferCoordinator(), but these lines already allow telemetry to consume the hour and report zero backlog. Once the actual inventory loads, the hourly deduplication prevents correcting that observation, biasing backlog metrics toward zero precisely on installations with slow recovery. Await the phone's readiness and refresh its inventory before marking fleet inputs as loaded.
Useful? React with 👍 / 👎.
| _ring = ring ?? PendantRingObserver.instance; | ||
|
|
||
| static final FleetBacklogTelemetry instance = FleetBacklogTelemetry(); | ||
| static const flag = 'mobile-fleet-backlog-telemetry'; |
There was a problem hiding this comment.
Register the telemetry flag so operators can control the pilot
The new mobile-fleet-backlog-telemetry key is absent from config/feature-flags.yaml (confirmed by repository-wide search). The documented store writer explicitly permits only registered keys: backend/scripts/omi_flags.py:68–73 rejects others with not a kind: posthog flag in config/feature-flags.yaml. Consequently, operators cannot use the supported writer to disable beta reporting or enable stable reporting, despite this flag being the advertised rollout and rollback control. Add a mobile-scoped registry entry alongside the reader.
Useful? React with 👍 / 👎.
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
What changed and why
SCA-4753 Phase 1: fleet-wide offline-sync backlog metrics. Today the backlog (audio waiting on the Omi, on the phone, and uploaded but not yet settled) is visible only in one person's Sync details sheet. This sends one numbers-only snapshot per app installation per UTC hour to the existing
POST /v1/telemetry/fleetroute and puts p50/p95/p99, over-1 h / over-6 h shares, coverage, per-build regression and the SCA-4532 drain holdout comparison on the Omi Core Features "Offline sync backlog" row. Pipeline owner gaveDESIGN: OK for Phase 1 implementation and a limited piloton SCA-4753 (2026-11-27 09:10Z).Server (
backend/)telemetry/fleet_registry.json: fivesync_backlog_*families (audio on Omi / on phone / awaiting server, oldest phone age, oldest awaiting-server age), fourpendant_ring_*families, and eight fleet-native counters (ring snapshot, dropped increased, full, transfer started/abandoned/completed, unread hidden). New families areios|androidonly.cohortlabel (on_ge_3_0_20|holdout_ge_3_0_20|other) on ring items, validated againstlabel_sets; labeled events export asomi_client_labeled_events_totalfrom the existing collector (no_createdchildren).…_by_build_bucket_total{platform,build_band,le}at 1 h / 6 h / +Inf).build_bandcomes from the existingX-App-Build/X-App-Versionheaders;app_versionstays discarded.release_build_band: per-platform floor plus a per-process cap, replacing the Phase 0 allowlist inutils/sync/capture_end.py. That allowlist (1367–1520) matched none of the builds phones sent on 2026-11-28 (iOS 1597–1650, Android 1500/1651), so the Phase 0 by-build panel showed onlyolder.deploy/cloud_run_gmp_sidecar.yaml: sample limit 15,000 → 20,000. Backend peaked at 14,397 post-relabel samples per instance on 2026-11-28 (ro-prod GMPmax_over_time(scrape_samples_post_metric_relabeling[1d])); this PR adds up to 1,100 worst-case series, and over the limit GMP drops the instance's whole scrape. Ingestion is billed per sample emitted, not by the ceiling.App (
app/)services/telemetry/fleet_backlog_telemetry.dart: builds the snapshot from the same pending rows as the Sync details sheet. Empty queues are 0; a non-empty queue with no plausible time, or an unknown pendant inventory, is omitted (unknown, never 0). The hour is consumed before the request and never replayed;executeApigains optionalretries/retryServerErrorspass-throughs so this beacon sends once. Honors the analytics opt-out. Pilot: beta builds by default; flagmobile-fleet-backlog-telemetrydisabled stops every channel, enabled widens to store builds.services/telemetry/pendant_ring_observer.dart: ring fill, read share, net drain and foreground-backlog drain, drops and fullness from fresh ring INFO readings only (never the displayed on-device amount, which has shown 0 s with ~500k unread packets). Hooks: INFO reads/notifications inomi_connection.dart, transfer passes inring_storage_sync.dart.providers/sync_provider.dart: attaches the snapshot after the recording inventory loads.Cost and data: no Firestore, GCS or Redis reads or writes beyond the route's existing per-UID rate-limit key; at most one request per installation-hour (route budget 12/h/UID). No IDs, content or free text.
Rollback: flag
mobile-fleet-backlog-telemetryoff stops all sends; server-side, revert this PR (registry additions are additive and unused by older apps).Verification
omi-heavy:pytest tests/unit/test_fleet_telemetry.py test_sync_capture_end.py test_product_metrics.py test_monitoring_dashboard_query_budget.py test_monitoring_gmp_shadow.py test_core_feature_headline_contract.py test_critical_failure_alerts.py test_desktop_message_quota_router.py→ 210 passed, 1 skipped.bash app/test.sh test/services/telemetry/fleet_backlog_telemetry_test.dart test/unit/offline_processing_display_test.dart test/unit/wal_derived_views_test.dart→ spine 138 passed, focused 30 passed.generate_fleet_schema.py --checkand the GMP query inventory regenerate identically.Product invariants affected
Line-Count-Exception: app/lib/providers/sync_provider.dart | 1712 -> 1756 | SCA-4753 snapshot wiring reads this provider's private inventory state
Line-Count-Exception: app/lib/services/devices/connectors/omi_connection.dart | 1622 -> 1628 | observer hooks at the existing INFO read and notify sites
Line-Count-Exception: app/lib/services/wals/ring_storage_sync.dart | 1731 -> 1736 | transfer-pass outcome hooks in syncAll
UI-Evidence: none -- no UI changes; telemetry and Grafana dashboard JSON only
🤖 Generated with Claude Code