fix(dashboard): read delivery latency from AE double1 - #2782
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughDelivery timing now accepts numeric and string duration metadata, reads Analytics Engine ChangesDelivery timing pipeline
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AnalyticsEngine
participant CloudflareTimingReader
participant DeliveryStats
participant NativeObserveStats
AnalyticsEngine->>CloudflareTimingReader: return duration_ms and event metadata
CloudflareTimingReader->>DeliveryStats: provide normalized timing events
DeliveryStats->>DeliveryStats: resolve duration and build delivery samples
CloudflareTimingReader->>NativeObserveStats: provide normalized timing events
NativeObserveStats->>NativeObserveStats: resolve duration and build observe samples
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
Comment |
Visual diff passedVisual changesGenerated at 2026-07-28T23:49:21.083Z. Threshold: 0.1% pixel difference.
Commit: Open |
Merging this PR will degrade performance by 43.43%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | /updates manifest response with metadata |
70.2 µs | 124.1 µs | -43.43% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix/dashboard-delivery-tabs-and-latency (8de0d58) with main (36a71e9)
Footnotes
-
2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
9580fdd to
3725766
Compare
Prefer Analytics Engine double1 duration, drop the bad timing GROUP BY, and skip caching empty latency windows so prod can surface download timing after deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
3725766 to
bae20a9
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_c867206f-6d41-403d-9cd5-44bcfd391a05) |
Deduplicate double1/metadata duration parsing for delivery and native-observe paths to clear Sonar new-code duplication. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_956eaa28-dbec-4fb0-a215-cf2f6b62ef2c) |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 13 minutes. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |



Summary (AI generated)
double1(written by/statswhen plugins report timing), not metadata alone.GROUP BYon the timing-events AE query so rows are not collapsed incorrectly.event.duration_mswhen building delivery samples and native-observe samples.duration_ms/ updater requirement.UI tab chrome / Notifications beta / email-vs-stats tab work from earlier drafts is out of scope — already shipped in #2786.
Motivation (AI generated)
#2778 wired the CF read path, but prod still showed empty latency because the query never selected
double1, used a harmfulGROUP BY, and cached zero-sample responses. #2786 fixed dashboard tab UI only; this PR is the remaining data-path fix.Business Impact (AI generated)
After API worker deploy, orgs whose devices already report download duration can see p50/p75/p95/p99 on the dashboard instead of a permanent empty state.
Test Plan (AI generated)
bunx vitest run tests/update-delivery-stats.unit.test.ts tests/native-observe-stats.unit.test.ts tests/analytics-engine-sql.unit.test.tsduration_ms/ AEdouble1shows percentiles on Delivery tabGenerated with AI
Note
Medium Risk
Changes the analytics read path and cache behavior for delivery latency; incorrect duration parsing or caching could show wrong percentiles or delay populated charts, but scope is observability only—not auth or billing.
Overview
Fixes update delivery latency on the dashboard by reading download duration from Analytics Engine
double1(written when/statsreports timing), not only from event metadata.The timing-events query now selects
double1, drops aGROUP BYthat collapsed rows, andresolveUpdateDeliveryTimingDurationMsprefers AE duration then metadata (including numericduration_ms/duration).parseStatsDurationMsis shared across delivery stats and native observe instead of duplicated parsers.Caching no longer stores responses with zero samples (CF or Postgres), so empty windows from ingest lag are not stuck for the cache TTL. A cloudlog fires when CF returns events but zero delivery samples. Empty-state copy now mentions
duration_msondownload_completeand updating@capgo/capacitor-updater.Reviewed by Cursor Bugbot for commit 8de0d58. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Bug Fixes