Skip to content

Conversation

@lsinger
Copy link
Contributor

@lsinger lsinger commented Jan 19, 2026

ref https://linear.app/ghost/issue/BER-2985

Allowing all complimentary members to upgrade to a paid plan. In turn removed allowCompMemberUpgrade (because that would now always return true for all comped members) and simplified the places where it was used.


Note

Makes complimentary members eligible to upgrade like free members and removes now-redundant gating logic.

  • Removes allowCompMemberUpgrade from utils/helpers and all call sites
  • Simplifies upgrade flow: treats complimentary members as upgrade-eligible in account-plan-page and paid-account-actions (always shows Change button unless only free plans)
  • Adjusts checkout/update logic to route complimentary members through checkoutPlan instead of subscription update paths
  • Cleans app.js page resolution (no longer forces accountPlan to accountHome for complimentary members)
  • Adds/updates tests to cover complimentary upgrade paths (single/multi-tier, monthly/yearly, cancelled subscriptions, offers) and adds complimentaryWithCancelledSubscription fixture

Written by Cursor Bugbot for commit 8090bc9. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Walkthrough

The PR removes the exported helper allowCompMemberUpgrade and all imports/usages of it. Routing (apps/portal/src/app.js), the account plan page, and the paid-account-actions component are updated to base gating directly on isPaidMember and isComplimentaryMember; PlanUpdateButton now accepts only isPaid. The account-plan-page file also adds and exports AccountPlanPageStyles (CSS). Test coverage is expanded with many complimentary-member upgrade scenarios and a new complimentaryWithCancelledSubscription fixture.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • kevinansfield
  • sagzy
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: allowing complimentary members to upgrade to paid plans, which is the primary objective of this PR.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the removal of allowCompMemberUpgrade, simplification of upgrade flows, test additions, and fixture updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

React E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 21163089875 -n playwright-report-react -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

1 similar comment
@github-actions
Copy link
Contributor

React E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 21163089875 -n playwright-report-react -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

Copy link
Contributor

@sagzy sagzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I create a comped member locally, the subscriptions array is an empty array in the GET /members/api/member/ call and therefore allowCompMemberUpgrade is true.

So this does seem to work already without the changes in the normal use case. Reading through the conversation on the Linear issue, it seems this fixes an edge case where member has a paid sub -> cancelled it -> got a comped sub - which is indeed pretty much an edge case.

I don't think we need to cover this specific edge case via automated test, but it would be great to have a test for the more general case: "a comped member can upgrade to a paid plan" - what do you think?

We should be able reuse the existing upgrade tests for free members and apply them to comped members: apps/portal/test/upgrade-flow.test.js

<h3>{planLabel}</h3>
<PlanLabel price={price} isComplimentary={isComplimentary} subscription={subscription} />
</div>
<PlanUpdateButton isComplimentary={isComplimentary} isPaid={isPaid} isCancelled={isCancelled} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like isCancelled prop was never used 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah 😬

@lsinger
Copy link
Contributor Author

lsinger commented Jan 20, 2026

I don't think we need to cover this specific edge case via automated test, but it would be great to have a test for the more general case: "a comped member can upgrade to a paid plan" - what do you think?

Thank you @sagzy -- I Claude added tests for the regular and the edge case in 73a03fd.

Copy link
Contributor

@sagzy sagzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

Previously only complimentary members with expiring access could upgrade.
Now all complimentary members can access the plan selection page and upgrade.
Since all complimentary members can now upgrade, this function was redundant
with isComplimentaryMember. Simplified all call sites to use isComplimentaryMember
directly and removed dead code that could never execute.
Covers the general case where a comped member can upgrade to a paid
plan, including the edge case where they previously had a cancelled
paid subscription.
@lsinger lsinger force-pushed the fix/allow-comp-upgrade branch from 73a03fd to c8135ef Compare January 21, 2026 10:11
Leftover import from helper function removal was causing lint failure
@lsinger lsinger merged commit 7618277 into main Jan 21, 2026
36 checks passed
@lsinger lsinger deleted the fix/allow-comp-upgrade branch January 21, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants