diff --git a/frontend/src/lib/square/square.ts b/frontend/src/lib/square/square.ts index 0a5483d..73dcf19 100644 --- a/frontend/src/lib/square/square.ts +++ b/frontend/src/lib/square/square.ts @@ -70,16 +70,28 @@ export function loadSquareSdk(): Promise { script.src = sdkUrl(); script.async = true; script.dataset.squareSdk = 'true'; + + // Non-sticky-rejection invariant: a FAILED load attempt must never poison + // the cached promise. Concurrent callers during one attempt share the same + // in-flight promise (good — single script load), but a REJECTED promise is + // cleared here so the next getSquarePayments() call starts a fresh attempt + // instead of returning the same error forever. The dead