From 9f1c738ab2f76fe2acf6208a7eb0f318989ebb99 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Sat, 13 Jun 2026 17:08:27 -0700 Subject: [PATCH] [eric] free-trial: refetch settings after mint unconditionally (arms even if the response is unreadable) --- frontend/src/app/Main.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/Main.tsx b/frontend/src/app/Main.tsx index a4c6f494..ab887c45 100644 --- a/frontend/src/app/Main.tsx +++ b/frontend/src/app/Main.tsx @@ -231,10 +231,11 @@ const SettingsLoader: React.FC<{ children: React.ReactNode }> = ({ children }) = // user can run an agent immediately. The backend no-ops if a real key or // subscription exists, so this is safe to fire on every launch. fetch(`${API_BASE}/subscription/free-trial/mint`, { method: 'POST' }) - .then((r) => (r.ok ? r.json() : null)) - .then((data) => { if (data && data.armed) dispatch(fetchSettings()); }) .catch(() => {}) - .finally(() => { dispatch(markFreeTrialArmSettled()); }); + // The backend arms server-side regardless of whether the browser can read the mint + // response (a transient boot-time CORS/timing miss makes `data` unreadable), so refetch + // unconditionally, the GET is the only reliable signal the UI gets that it armed. + .finally(() => { dispatch(fetchSettings()); dispatch(markFreeTrialArmSettled()); }); }); }, [dispatch]);