fix(missions): swap cache:no-store for query cache-buster (hang fix)
ci / gates (push) Successful in 7s
ci / frontend (push) Successful in 26s
ci / rust (push) Successful in 3m23s
ci / e2e (push) Skipped
ci / publish (push) Successful in 34s

fetch(url, { cache: no-store }) was hanging forever through the
edge proxy on the mission API endpoints — requests never reached
postgres and the client-side loading state was stuck true, making
Refresh appear broken. Regressed in d42398d.

Switch to a per-request _t=Date.now() query param on GETs — same
cache-defeat effect, doesn't change fetch semantics.
This commit is contained in:
Omar Sobh
2026-07-22 00:20:33 -07:00
parent b7f0b46971
commit d207c2c043
+8 -6
View File
@@ -174,12 +174,14 @@ export interface CreateMissionRequest {
} }
async function api<T>(path: string, init?: RequestInit): Promise<T> { async function api<T>(path: string, init?: RequestInit): Promise<T> {
// Missions endpoints are mutable state (statuses transition every // Missions endpoints are mutable state. We bypass browser cache
// few seconds) so we always bypass the browser cache. The old cache // via a per-request `_t` query param rather than fetch's `cache:
// heuristic could serve a stale response for the manual Refresh // "no-store"` mode, which appears to hang forever through the
// click, making it look like a no-op. // edge proxy for reasons TBD.
const r = await fetch(path, { const method = init?.method ?? "GET";
cache: "no-store", const busted =
method === "GET" ? `${path}${path.includes("?") ? "&" : "?"}_t=${Date.now()}` : path;
const r = await fetch(busted, {
...init, ...init,
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",