The Products page offers a plan switch on a subscription the switch cannot change #199
Open
opened 2026-10-09 16:01:30 +00:00 by cgalo5758
·
0 comments
Labels
Clear labels
accessibility
area/billing
area/catalog
area/discourse
area/domains
area/entitlements
area/fedwiki
area/identity
area/integrations
area/licensing
area/member-ui
area/meta
area/operator-ui
area/ops
area/testing
duplicate
good-first-issue
invalid
privacy
security
upstream
wontfix
A barrier for people using assistive technology or a keyboard alone.
The Stripe mirror, checkout, subscriptions, invoices, fulfillment.
Products, prices, plan ladders, purchasability.
The Discourse integration.
The domains registry, claims, placements, the certificate ask.
Entitlement sets, rules, grants, pools, provisioning.
The Federated Wiki integration and farm sync.
Sign-in, sessions, persons, organizations, workspaces, roles.
The provider registry, outbox and webhooks in general.
Licenses, the contributor agreement, SPDX headers.
Member pages.
The repository itself, its contributing guide, CI, the tracker and the workflow.
Operator pages, forms, lists, the design system.
Deployment, configuration, migrations, workflows, instance settings.
The test stack, screens, lint, walkthroughs.
Closed because another issue already covers it.
Small, self-contained, and explained enough to be a first contribution.
Closed because it is not a ticket for this repository.
Touches what a person's data reveals.
Touches authentication, authorization, secrets or data exposure.
Waits on another repository or project before it can move.
Closed because it will not be done, with the reason in the last comment.
kind
bug
The software does something other than what it promises; closed when it again does what it promises.
kind
debt
Code, tests or tooling to clean up with nothing visible changing; closed when they are cleaner.
kind
design
A question to settle before work can be defined; closed when the decision is written down.
kind
docs
Documentation that is wrong or missing; closed when it says the right thing.
kind
enhancement
Something the software does not do yet; closed when it does.
priority
critical
Blocks the active milestone or harms members now.
priority
high
Next in line inside the active milestone.
priority
low
Inside the active milestone, when nothing else is left.
priority
medium
Inside the active milestone, after the high ones.
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#199
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
When the plan a member's organization holds names a subscription, the Products page gives the other tiers an enabled Upgrade or Downgrade button. Either button switches the subscription's price. In some states the console cannot find the Stripe ids that the switch would send. When the member clicks the button in one of these states, the switch preview refuses with "We couldn't complete that change. Try again in a moment.":
In the last two states, the current card shows its price and renewal date as usual. Nothing on the page tells this plan apart from one that can be switched. Trying again gives the same answer, and every click logs "plan move failed" as an error.
A subscription or item mapping can also be recorded in the other Stripe environment, or marked stale. That case fails one step later. The preview shows the confirmation, and then the switch refuses with "That plan is no longer available. Refresh the page and choose a current plan." After a refresh, the page draws the same enabled button.
The page draws its controls from the offer decision (
plans.Offer). The position it passes to that decision counts the plan as paid for by a subscription as soon as the provision names one (positionLoader.onLadder,internal/server/plan_offer.go).GetSwitchPreviewasks the same decision and gets the same yes. It then callsfulfillment.HasActiveSubscriptionOnLadder, which looks up the subscription and its item throughresolveLadderSubscription. Any failure there other than "no subscription" ends in the catch-all message ofrenderPlansAfterMove. OnlySwitchPlanchecks the Stripe environment; the preview does not.What should happen
The member offer spec says the Products page, the switch and its preview all decide through one function, "so no surface offers or accepts a move another refuses." So a tier whose switch cannot be carried out gets no enabled switch. To make that decision, the position records whether the subscription and its current item can be reached, as it already records for the target price. The preview refuses anything the switch would refuse, with the same answer.
Where
internal/server/plan_offer.go(positionLoader.onLadder,switchOffer);internal/server/member_plan_moves.go(GetSwitchPreview,renderPlansAfterMove);internal/fulfillment/plan_change.go(HasActiveSubscriptionOnLadder,resolveLadderSubscription,PreviewSwitch,SwitchPlan). #195 covers how a refused switch answers, and #197 covers a failed read in the same lookup.Steps
TestPlansDrawAnUnprojectedSubscriptionininternal/server/member_plans_offer_db_test.gobuilds the first state: a provision that names a subscription with no row. The test asserts that the lower tier's switch is enabled. On the Products page, clicking that Downgrade gets the catch-all message.Why it matters
A member is offered a plan change that cannot succeed and is told to try again. Reconcile writes the subscription, its mapping, its items, their mappings and the plan they pay for in one transaction. So the console's own writes do not leave the first three states, but rows written any other way do, and the page already has its own line for the first.