feat: deliver billable usage to Polar idempotently - #1729
Conversation
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (31)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-08-02T15:06:02.304Z · Commit: 60156ed |
c4a5e69 to
cac05f5
Compare
cac05f5 to
5d3b90b
Compare
Outcome
Polar can now deliver durable journaled billable usage through typed meter bindings. Each event carries a replay-safe Polar external ID; inserted and duplicate acknowledgements both resolve the local claim without a second provider increment. Delivery stays outside request handling, claims one bounded event at a time, and retains retryable or terminal failures with stable recovery Problems.
Usage delivery is bounded by a five-second provider attempt timeout, a 15-second provider retry window, and a minimum 30-second journal lease. Missing meter mappings and customers provide replay guidance, and a credential-gated live certification covers a deliberate usage event.
Fixes #1522
Verification
pnpm --filter @croco/billing-polar test— 98 passed; 3 credential-gated live tests skipped.pnpm --filter @croco/billing-polar typecheck,lint, andbuild— passed.pnpm public-api:check,pnpm problem-registry:check,pnpm docs:catalog:check, andpnpm docs:api-triggers:check— passed.Review notes
POLAR_USAGE_*environment variables; it was not run without credentials.