Report the NULL-plan send backstop in email_usage_get - #641
Conversation
email_sends_per_day joined nullPlanEmailFallbackLimits when the username-based email model landed, so plan-less users are capped at the deployment backstop rather than unlimited. email_usage_get still reported limit: null for them; use resolveEmailResourceLimit so the usage surface matches enforcement.
|
🔎 Preview deployed: https://kody-pr-641.kentcdodds.workers.dev Worker: Mocks:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe email usage capability's ChangesEmail send limit resolution
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Small follow-up to #635, found while running the post-deploy migration audit.
When the username-based email model merged,
email_sends_per_dayjoinednullPlanEmailFallbackLimits(100/day backstop for plan-less users) — but #636'semail_usage_getlanded in parallel with a hardcoded assumption that plan-less sends are unlimited, so it reportssends_today.limit: nullwhile enforcement actually caps at 100. Observed live right after the deploy:Fix: resolve the send limit through
resolveEmailResourceLimitlike the other email resources, so the usage surface matches enforcement. Updated the workers test expectation accordingly.npm run validategreen locally (the only test-expectation change is the NULL-plansends_today.limit).System recap — composes existing primitives (low risk)
Mode: recap · Base:
main@858befed· Head:c8f605a5Classification: composes — one capability read path aligned with the entitlement enforcement that already shipped; no primitive contracts change.
Primitives touched
emailemail_usage_getreports the existing send backstopentitlementsresolveEmailResourceLimitSystem map
Summary by CodeRabbit