Skip to content

Fix Proceed to Payment dead ends on the subscription lock screen - #274

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixbilling-make-proceed-to-payment-fail-247b87
Draft

Fix Proceed to Payment dead ends on the subscription lock screen#274
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixbilling-make-proceed-to-payment-fail-247b87

Conversation

@posthog

@posthog posthog Bot commented Aug 22, 2026

Copy link
Copy Markdown

Problem

  • A tenant whose trial ended or was canceled has only one forward path — the Proceed to Payment button on the subscription lock screen — and both of its failure modes end that path with no workaround.
  • Silent no-op: the checkout branch ran if (!checkoutProducts.length) return; but never disabled the button, so it looked live and gave no spinner, toast, or redirect. It also ignored hasInvalidCustom, which the update branch already honors.
  • Raw Relay error: CheckoutResult has no errors field, so a rejected checkout came back as errors with no data. Relay then rejected with its internal No data returned for operation ... string, which landed verbatim in the toast. The readable server message was only console.error-logged.

Changes

Symptom Fix
Button looks live but does nothing Disable it when there is nothing to buy (checkoutProducts.length === 0), matching the update branch
Invalid custom amount ignored in checkout Toast and stop before starting checkout, same as the update branch
Relay's internal wording shown to users In the Relay network layer, when the server returns errors and no data, throw the joined GraphQL error message so onError shows it; partial responses (data present) are unchanged

Notes

  • The Relay-layer change is global but safe: an errors-and-null-data response already rejected through onError/error boundaries — this only replaces the message text.
  • useProductSelection fires on mount and populates checkoutProducts for every non-PAYG selection, so the button enables normally and only disables when the selection is genuinely empty (e.g. pay-as-you-go only).

Test plan

  • npm run type-check clean
  • npm run lint:biome clean on changed files

Created with PostHog Desktop from this inbox report.

The checkout branch of SubscriptionSubmitButton returned silently when there
were no checkout products, so the button looked live but did nothing. It also
ignored hasInvalidCustom, unlike the update branch.

- Disable the button when there is nothing to buy.
- Toast on an invalid custom amount before starting checkout.
- Surface the GraphQL error message from the Relay network layer when the
  server returns errors and no data, instead of Relay's internal
  "No data returned for operation ..." wording.

Generated-By: PostHog Desktop
Task-Id: 7a768f5c-ed00-4e07-b773-0b2d42a1c090
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.

0 participants