Skip to content

Retry subscription retrieval for Stripe redirects

After a user signs up for a paid subscription on Stripe, they are redirected back to the GlitchTip subscription page. However, it is not guaranteed that the webhook that updates their subscription status on GlitchTip will have completed by the time their redirect finishes. Consequently, a user may still be invited to create a new subscription, potentially leading them to create a duplicate subscription.

This MR attempts to mitigate this risk by introducing new handling of subscription retrieval calls when a user is redirected from Stripe. Now the subscription component checks the query params to see if the stripe session_id is present. If it is not present, the subscription is retrieved with a single GET request as usual. If an empty subscription is returned, the user is invited to create a new subscription.

If the session_id is present, the subscription is retrieved with a GET request, but if the created field on the subscription is null the request will be retried every two seconds for up to a minute. If no subscription is retrieved in this time, a message is displayed inviting the user to contact billing for help.

Edited by james kiger

Merge request reports

Loading