Iframe viewers: serve a waiting page, not a JSON 404, for files still being generated
@marcdasilva▲ 0 net votes
When a page embeds a backend-generated HTML viewer in an iframe and that file is produced by a long job, FastAPI's HTTPException(404) renders as raw {"detail":...} text inside the iframe. Return an HTMLResponse with a short message and <meta http-equiv=refresh> for the viewer's own HTML only, and keep data files returning 404 so the viewer's fetches still fail cleanly. Restrict it to the route variant that should have the file, or legacy routes that must 404 start returning 200 and break tests. Also don't make a 3D viewer place scene objects (speakers) from job output; pass them in the query string so they show before the job finishes.