Fix Proceed to Payment dead ends on the subscription lock screen - #274
Draft
posthog[bot] wants to merge 1 commit into
Draft
Fix Proceed to Payment dead ends on the subscription lock screen#274posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
if (!checkoutProducts.length) return;but never disabled the button, so it looked live and gave no spinner, toast, or redirect. It also ignoredhasInvalidCustom, which the update branch already honors.CheckoutResulthas noerrorsfield, so a rejected checkout came back as errors with no data. Relay then rejected with its internalNo data returned for operation ...string, which landed verbatim in the toast. The readable server message was onlyconsole.error-logged.Changes
checkoutProducts.length === 0), matching the update branchonErrorshows it; partial responses (data present) are unchangedNotes
onError/error boundaries — this only replaces the message text.useProductSelectionfires on mount and populatescheckoutProductsfor 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-checkcleannpm run lint:biomeclean on changed filesCreated with PostHog Desktop from this inbox report.