Skip to content

fix: stop double-counting install success on /data metrics#2705

Merged
riderx merged 1 commit into
mainfrom
fix/public-live-update-success-rate
Jul 16, 2026
Merged

fix: stop double-counting install success on /data metrics#2705
riderx merged 1 commit into
mainfrom
fix/public-live-update-success-rate

Conversation

@riderx

@riderx riderx commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Device-days that both failed and later set were counted as success and failure, which pulled the public 30-day success rate down to ~70% while admin global stats stayed near ~84%.
  • Outcomes now prefer success: a device-day only counts as failure when it never installed successfully that day.
  • Restored discord_username / github_username types wiped by the latest auto-sync so typecheck matches feat(account): add Discord and GitHub usernames #2700.

Test plan

  • bunx vitest run tests/public-live-update-metrics.unit.test.ts tests/public-stats.unit.test.ts
  • Deploy API, then compare /private/website_stats/live_updates success_rate with admin Updates success rate
  • Confirm https://capgo.app/data/ KPI moves toward the global stats figure after cache TTL (~5 min)

Made with Cursor

Review in cubic

A device that failed then eventually set on the same day was counted as both success and failure, which dragged the public success rate down versus global stats. Also restore social username types wiped by auto-sync so typecheck matches #2700.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 81dbd14a-7501-49e7-b7c9-b6179ef1a1b1

📥 Commits

Reviewing files that changed from the base of the PR and between caa8138 and 12f02cf.

📒 Files selected for processing (4)
  • src/types/supabase.types.ts
  • supabase/functions/_backend/utils/cloudflare.ts
  • supabase/functions/_backend/utils/supabase.types.ts
  • tests/public-live-update-metrics.unit.test.ts

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing fix/public-live-update-success-rate (12f02cf) with main (6e178ee)2

Open in CodSpeed

Footnotes

  1. 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.

  2. No successful run was found on main (caa8138) during the generation of this report, so 6e178ee was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@sonarqubecloud

Copy link
Copy Markdown

@riderx riderx marked this pull request as ready for review July 16, 2026 00:55
@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_ef56bb62-8abb-495f-a277-85297d90048d)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Not approving: Cursor Bugbot completed with status skipping (usage limit reached) and did not produce a clean review. Human review is needed for this public metrics query change; assigned reviewers.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot requested review from Dalanir and WcaleNieWolny July 16, 2026 00:56

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@riderx riderx merged commit 18b4392 into main Jul 16, 2026
58 of 82 checks passed
@riderx riderx deleted the fix/public-live-update-success-rate branch July 16, 2026 01:04

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low. Cursor Bugbot did not complete (check skipped due to usage limit), so I cannot approve from automated review signals. Human review is needed for this metrics query fix.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

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