fix(stats): address success rate review comments from #2988

Draft
RI
2mo ago
+65-23

Summary (AI generated)

  • getUpdateStatsCF and get_update_stats() now include apps with install/fail outcomes even when no get event occurred in the snapshot window.
  • Global total is aggregated from all apps in the query result, not only post-filtered rows.
  • Public /data headline + daily success rate now uses the same app_log set/failure event stream as platform/country/version breakdowns.

Motivation (AI generated)

Follow-up to #2988 review comments: the global success rate still dropped install/fail-only apps due to a get > 0 filter, and public headline metrics mixed version_usage with app_log breakdowns.

Business Impact (AI generated)

More accurate global_stats snapshots and internally consistent public success rate numbers across headline and dimensional views.

Test Plan (AI generated)

  • bunx vitest run tests/public-live-update-metrics.unit.test.ts tests/public-stats.unit.test.ts
  • Compare /private/website_stats/live_updates headline vs platform breakdown success rates after deploy
  • Verify next global_stats cron stores success_rate including install/fail-only apps

Generated with AI

Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.