WIP: Changed Portal offer links to always open the offer page#28322
WIP: Changed Portal offer links to always open the offer page#28322kevinansfield wants to merge 1 commit into
Conversation
no issue Offer links should show the same Portal offer flow regardless of the Portal button setting, while checkout buttons continue to start checkout directly.
|
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 (11)
WalkthroughThis PR refactors Portal's offer-link behavior to streamline the code path and improve handling of existing subscriptions. The key changes include removing conditional portal-button logic to always open offer popups, implementing metadata-based upgrade marking for logged-in checkouts, and adding a dedicated error handler that redirects users with existing subscriptions to sign-in instead of retrying checkout. Newsletter selection is now skipped for authenticated users. API error responses now preserve error codes for better error classification. Comprehensive test updates verify the new behavior across data-attributes, signup, and upgrade flows. Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66aeebee36
ℹ️ 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".
| if (e.code === CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTION) { | ||
| return { | ||
| page: 'magiclink', |
There was a problem hiding this comment.
Avoid showing magic-link success for authenticated paid members
When an already-authenticated paid member hits a direct paid signup link (for example #/portal/signup/monthly), signup still calls checkout and the members API returns CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTION; in router-controller.js that path only sends a sign-in email for unauthenticated requests with an email, so no email is sent for the authenticated member. This new branch nevertheless switches Portal to the magic-link page with an empty email, telling the user to check their inbox instead of showing the checkout failure/account state.
Useful? React with 👍 / 👎.
Summary
Testing