Fixed retention offer not rendering for 1 mo repeating offers#26748
Fixed retention offer not rendering for 1 mo repeating offers#26748
Conversation
closes https://linear.app/ghost/issue/BER-3413 - when a member signs ups with a repeating 1 month offer, the next payment is not discounted - therefore, they should be able to redeem a retention offer
There was a problem hiding this comment.
💡 Codex Review
The new if (!offerId) return false path drops the previous check for synced Stripe discounts, so subscriptions with discount_start/discount_end but no mapped offer_id are now treated as having no active offer. This can happen in existing sync paths that keep Stripe discount dates even when offer mapping fails (for example, invalid coupon-to-offer conversion), and it will surface retention offers while the next invoice is still discounted, allowing unintended stacking of discounts.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthroughhas-active-offer was changed to accept an optional options parameter and now includes current_period_end in the subscription payload. Legacy discount_start/discount_end branch was removed; offer lookup is performed (offersAPI.getOffer) and discountWindow is derived via getDiscountWindow(subscriptionData, offer). Trial-based early exit remains; errors from offer lookup are caught and treated as blocking (returns true). Two end-to-end retention-offer tests and multiple unit tests were added and test helpers were extended to support startDate and currentPeriodEnd. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 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 |
🤖 Velo CI Failure AnalysisClassification: 🟠 SOFT FAIL
|
closes https://linear.app/ghost/issue/BER-3413 - when a member signs ups with a repeating 1 month offer, the next payment is not discounted - therefore, they should be able to redeem a retention offer
closes https://linear.app/ghost/issue/BER-3413