Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(keep): add SSE heartbeat to prevent thumbnail idle timeout loop

The oven thumbnail generation (20-45s) left the SSE connection idle,
causing Netlify infra to kill it. Client retried endlessly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+16 -2
+16 -2
system/netlify/functions/keep-mint.mjs
··· 784 784 // ═══════════════════════════════════════════════════════════════════ 785 785 if (!useCachedMedia) { 786 786 await send("progress", { stage: "thumbnail", message: `Awaiting ${thumbW}x${thumbH}@2x WebP...` }); 787 - 788 - const thumbResult = await thumbnailPromise; 787 + 788 + // Send heartbeat messages to keep the SSE connection alive while 789 + // the oven generates the thumbnail (can take 20-45s). 790 + const heartbeat = setInterval(async () => { 791 + try { 792 + const elapsed = ((Date.now() - processStartTime) / 1000).toFixed(0); 793 + await send("progress", { stage: "thumbnail", message: `Still baking… (${elapsed}s)` }); 794 + } catch {} 795 + }, 10000); 796 + 797 + let thumbResult; 798 + try { 799 + thumbResult = await thumbnailPromise; 800 + } finally { 801 + clearInterval(heartbeat); 802 + } 789 803 790 804 if (!thumbResult?.ipfsUri) { 791 805 const errorMsg = thumbResult?.error || "unknown error";