fix: handle webhook-race on Premium Geo DB addon enable#3123
Conversation
Console (appwrite/console)Project ID: Sites (1)
Tip GraphQL API works alongside REST and WebSocket protocols |
Greptile SummaryThis PR fixes a confusing UX bug where the Premium Geo DB enable modal would surface an "Invoice no longer exists" error when the Stripe webhook activated the addon just before the console's explicit
Confidence Score: 5/5Safe to merge — the change is a narrow error-handling addition with no impact on the happy path. The change wraps a single API call in a try/catch and swallows only the two specific error types the PR targets, matching the identical guard already in use elsewhere in the same settings directory. State invalidation and the success notification still run after a caught error, so the UI stays consistent with actual backend state. No new code paths are introduced and the existing 409 handling is untouched. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(premiumGeoDB): treat webhook-race 40..." | Re-trigger Greptile |

When enabling the Premium Geo DB addon, the Stripe webhook can activate the addon and mark its invoice
succeededjust before the console's explicitconfirmAddonPaymentcall. The backend then can't find a pending invoice and returnsbilling_invoice_not_found(HTTP 404) — even though the addon is already enabled and charged.The enable modal's
catchonly special-cased409, so this benign race surfaced a confusing "Invoice no longer exists" error to the user despite success.This tolerates the race 404 (
billing_invoice_not_found/addon_not_found) on the inline confirm — re-syncing state and reporting success — mirroring the existing handling inpremiumGeoDB.svelte'sconfirmAddon.