Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

arena: live-reload on new deploy (same polling pattern as dumduel)

Boot fires a /api/version long-poll; when deployed hash changes,
send window:reload through bios. No interval — one in-flight fetch
at a time. Keeps players on latest code without manual refresh.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+21
+21
system/public/aesthetic.computer/disks/arena.mjs
··· 272 272 netSendFn = send; 273 273 myHandle = handle?.() || "guest_" + Math.floor(Math.random() * 9999); 274 274 netConnectedAt = Date.now(); 275 + 276 + // 🔄 Live-reload on new deploy (same pattern as dumduel.mjs). 277 + // Polls /api/version until the `deployed` value changes, then asks bios 278 + // to reload the page. Fire-and-forget; any error silently gives up. 279 + (async () => { 280 + try { 281 + const res = await fetch("/api/version"); 282 + if (!res.ok) return; 283 + const info = await res.json(); 284 + const current = info.deployed; 285 + while (true) { 286 + try { 287 + const r = await fetch(`/api/version?current=${current}`); 288 + if (!r.ok) break; 289 + const data = await r.json(); 290 + if (data.changed !== false) { netSendFn?.({ type: "window:reload" }); break; } 291 + } catch { break; } 292 + } 293 + } catch {} 294 + })(); 295 + 275 296 if (!net) return; 276 297 277 298 const { socket, udp } = net;