Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,23 @@
return;
}

await sdk.forConsoleIn(page.params.region).projects.confirmAddonPayment({
projectId: page.params.project,
addonId: paymentAuth.addonId
});
try {
await sdk.forConsoleIn(page.params.region).projects.confirmAddonPayment({
projectId: page.params.project,
addonId: paymentAuth.addonId
});
} catch (e) {
// A 404 here means the Stripe webhook already consumed the invoice
// and activated the addon (race) — the addon is enabled, so sync
// state and assume success rather than surfacing the error.
if (
e?.type !== 'billing_invoice_not_found' &&
e?.type !== 'addon_not_found' &&
e?.code !== 404
) {
throw e;
}
}

await Promise.all([
invalidate(Dependencies.ADDONS),
Expand Down
Loading