From 0fdd07bec21f650bf043ad7bde887e455aea05a3 Mon Sep 17 00:00:00 2001 From: pedro-bento Date: Mon, 5 Oct 2026 20:56:47 +0100 Subject: [PATCH] fix(dashboard): PUT the handoff bundle through the app's API base The backend's upload_url embeds the request host; behind the dev proxy that is the Docker-internal backend:8000, which the browser cannot resolve, so the ZIP PUT died as a bare 'Failed to fetch' and aborted the job. Use /api/uploads/ via the app's own base instead, and label handoff failures clearly so they are not mistaken for a process error. --- dashboard/src/App.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 650482a..8b76989 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -705,8 +705,12 @@ function App() { }); if (!createRes.ok) throw new Error(`Handoff upload failed: ${readableError(await createRes.text())}`); const slot = await createRes.json(); - if (!slot?.upload_url) throw new Error('Handoff upload failed: the server returned no upload URL.'); - const putRes = await apiFetch(slot.upload_url, { + if (!slot?.upload_id) throw new Error('Handoff upload failed: the server returned no upload id.'); + // PUT through the app's own API base rather than the absolute + // `upload_url` the server returns: behind the dev proxy that URL's host + // is the Docker-internal `backend:8000`, which the browser cannot + // resolve, so the request dies with a bare "Failed to fetch". + const putRes = await apiFetch(`/api/uploads/${encodeURIComponent(slot.upload_id)}`, { method: slot.method || 'PUT', headers: { 'Content-Type': 'application/zip' }, body: data.handoffFile, @@ -716,6 +720,11 @@ function App() { handoffId = putData.upload_id || slot.upload_id || null; if (!handoffId) throw new Error('Handoff upload failed: the server returned no upload id.'); setLogs((l) => [...l, 'Handoff bundle attached — transcription will be skipped.']); + } catch (e) { + const msg = e?.message || String(e); + throw new Error( + msg.startsWith('Handoff upload failed') ? msg : `Handoff upload failed: ${msg}`, + ); } finally { setHandoffUploading(false); }