diff --git a/modules/rsplat/components/folk-splat-viewer.ts b/modules/rsplat/components/folk-splat-viewer.ts index c6b74c5..b304278 100644 --- a/modules/rsplat/components/folk-splat-viewer.ts +++ b/modules/rsplat/components/folk-splat-viewer.ts @@ -609,10 +609,23 @@ export class FolkSplatViewer extends HTMLElement { // Ticker keeps running — progress bar continues advancing during polling // Poll for completion + let poll404Count = 0; const pollInterval = setInterval(async () => { try { const pollRes = await fetch(`/api/3d-gen/${job_id}`); - if (!pollRes.ok) return; + if (!pollRes.ok) { + if (pollRes.status === 404 && ++poll404Count >= 3) { + // Job lost — server likely restarted + stopTicker(); + clearInterval(pollInterval); + progress.style.display = "none"; + status.textContent = "Job lost — server restarted. Please try again."; + actions.style.display = "flex"; + submitBtn.disabled = false; + } + return; + } + poll404Count = 0; const job = await pollRes.json() as any; if (job.status === "complete") {