File tree Expand file tree Collapse file tree
src/routes/(console)/project-[region]-[project]/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 return ;
6161 }
6262
63- await sdk .forConsoleIn (page .params .region ).projects .confirmAddonPayment ({
64- projectId: page .params .project ,
65- addonId: paymentAuth .addonId
66- });
63+ try {
64+ await sdk .forConsoleIn (page .params .region ).projects .confirmAddonPayment ({
65+ projectId: page .params .project ,
66+ addonId: paymentAuth .addonId
67+ });
68+ } catch (e ) {
69+ // A 404 here means the Stripe webhook already consumed the invoice
70+ // and activated the addon (race) — the addon is enabled, so sync
71+ // state and assume success rather than surfacing the error.
72+ if (
73+ e ?.type !== ' billing_invoice_not_found' &&
74+ e ?.type !== ' addon_not_found' &&
75+ e ?.code !== 404
76+ ) {
77+ throw e ;
78+ }
79+ }
6780
6881 await Promise .all ([
6982 invalidate (Dependencies .ADDONS ),
You can’t perform that action at this time.
0 commit comments