🐛 Fixed "check your email" popup for already-logged-in members clicking checkout buttons#28505
Conversation
|
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 (7)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughThis PR updates signup error handling to return a dedicated error (action: 'signup:failed' with a non-auto-hiding popup) for authenticated members when checkout fails with CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTION, keeps previous redirect behavior for unauthenticated users, adds unit and signup-flow tests for the authenticated case, moves handleSignupQuery to run after initial setState, updates localization context, and bumps the portal package version. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ 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 |
f5e871b to
42ad855
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42ad855afc
ℹ️ 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".
8c959de to
e6ec313
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/portal/test/signup-flow.test.js`:
- Around line 588-612: The test sets window.location.hash but only resets it at
the end, which leaks state on failures; wrap the main test body (the setup call,
waits and assertions that use setup(), ghostApi, utils, popupFrame, and
within(...).queryByText) in a try/finally and move window.location.hash = ''
into the finally block so the hash is always cleared regardless of assertion
failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e98ff2c3-360d-4fe6-bf3c-f8e6e411df7f
📒 Files selected for processing (6)
apps/portal/package.jsonapps/portal/src/actions.jsapps/portal/src/app.jsapps/portal/test/actions.test.tsapps/portal/test/signup-flow.test.jsghost/i18n/locales/context.json
✅ Files skipped from review due to trivial changes (1)
- apps/portal/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
- ghost/i18n/locales/context.json
- apps/portal/test/actions.test.ts
- apps/portal/src/actions.js
e6ec313 to
8ccf87a
Compare
…mbers closes https://linear.app/ghost/issue/BER-3724/show-correct-error-for-active-subscriber-checkout-attempts When a logged-in paid member clicked a paid signup button, e.g. a theme button using a `data-portal="signup/{tier}/{cadence}"` attribute, Portal showed the magic-link confirmation page even though the server rejects the checkout without sending any email, so members were told to check their inbox for an email that never arrived. The magic-link page is only correct for the anonymous flow, where the server emails a sign-in link before rejecting the checkout. Logged-in members now see an error notification explaining they already have an active subscription, reusing the existing translated string from the gift redemption flow.
8ccf87a to
a144a45
Compare
closes https://linear.app/ghost/issue/BER-3724/
When a logged-in paid member clicked a paid signup button — e.g. a theme button using a
data-portal="signup/{tier}/{cadence}"attribute — the server rejected the checkout withCANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTIONwithout sending any email, but Portal showed the magic-link confirmation page. Members were told to check their inbox for an email that never arrived.This was a regression from #28322, which added handling for
CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTIONto support the anonymous offer-signup flow. The magic-link page is only correct in that flow, where the server emails a sign-in link before rejecting the checkout — for authenticated members no email is sent.Logged-in members now see an error notification explaining they already have an active subscription instead of the misleading "check your email" page. The message reuses the existing translated string from the gift redemption flow, so it's already localised across all supported locales.