Repository navigation
fix(subscription): preserve legacy cadences during metadata resolution - #5267
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughPersisted subscriptions with legacy short item cadences can now load and resolve item features despite the cadence validation error. Tests cover preserved validation behavior, cancellation, and subscription billing sync. ChangesLegacy item cadence handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The reviewed change has no identified issue that needs resolution before merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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 |
Overview
Existing subscriptions with item billing cadences under 24 hours fail view loading when feature metadata is resolved, preventing billing synchronization. Tax metadata resolution can also block cancellation by revalidating the same legacy cadence.
Permit only the legacy minimum-cadence error during feature and tax metadata resolution. Create/update validation remains strict, other validation errors still fail, and stored cadences are preserved.
Notes for reviewer
Summary by CodeRabbit
This PR appears safe to merge; no actionable issues were found.
What we checked:
errorsx.IsOnlyrejects the error tree if any error falls outside the allowed list.spec.Validate()before saving items. The metadata exception does not replace those checks.Summary
This PR lets feature and tax metadata resolution preserve stored legacy billing cadences shorter than 24 hours.
ErrRateCardBillingCadenceTooShortis tolerated; other errors still fail.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Stored subscription] --> B[Resolve item feature] B --> C{Errors from ChangeMeta} C -->|None or only short cadence| D[Load subscription view] C -->|Any other error| E[Return error] D --> F[Billing sync] D --> G[Cancel subscription] G --> H[Resolve tax metadata] H --> I{Errors from ChangeMeta} I -->|None or only short cadence| J[Save cancellation] I -->|Any other error| E K[Create or update] --> L[Strict spec validation] L -->|Short cadence| EReviews (1) · Last reviewed commit: "fix(subscription): preserve legacy caden..." · Reviewed by Greptile