JamesReviewsMusic
JRM-27Replace Socket.IO with SSE and make image jobs async
Description
The artist image/header update jobs currently hold their POST request open for the entire run (minutes of Puppeteer work) while progress streams over a Socket.IO connection that accepts anyone who connects, logged in or not. All the traffic is one-way server-to-client, which is exactly what server-sent events are for.
- Job endpoints return 202 with a job id immediately: POST /api/jobs/artist-headers and /api/jobs/artist-images
- GET /api/jobs/:id/events streams progress via Hono's streamSSE, behind the admin auth middleware like any other route
- Frontend: useSocket/useJobProgress switch to EventSource, the reducer logic stays the same
- Delete the Socket.IO server, socket.io-client, the /ws Traefik router and the /ws OPTIONS handler
Sub-tickets
0No sub-tickets yet.
Links
No links.
Comments
0No comments yet.