← Latest updates
Updates: April 2026 (part 1 of 2)
What shipped on Dope Vibes in April 2026 (part 1 of 2).
Reliability Pass: 3-Cam Joins, Graceful Restarts, IG Audio Mix, TURN Quota Alerts
April 28, 2026
- Instagram Live audio mix now reconciles against the live room. Previously the mixed track was a one-shot snapshot at stream start — viewers heard whoever was present then, but as partners cycled the mix decayed until only the streamer's mic was audible. The AudioContext + MediaStreamDestination are now persistent and a reconcile effect adds/removes MediaStreamAudioSourceNodes as remoteStreams changes. Cleanup disconnects every node before closing the context.
- 3-person multi-cam joins: vote threshold lowered from unanimous to majority, so a 2-person room only needs one approval to admit a 3rd cam (was 2 of 2 — one AFK member silently blocked all joins). 3+-person rooms still need majority. When a vote times out or rejects, the requester now sees a transient toast ("Members didn't respond — looking for another room" / "Members declined…") instead of dropping silently into a solo waiting room with no explanation. Server logs at timeout now include approval count for diagnosing the remaining failure modes.
- Graceful Railway restart: SIGTERM / SIGINT trap broadcasts a SERVER_RESTARTING event, kills any in-flight ffmpeg streams cleanly so RTMP endpoints get a proper EOS, then closes the HTTP and Socket.io servers in sequence within Railway's 30s grace window. The client renders a yellow "Server is updating — you'll auto-reconnect" banner in place of the generic reconnect spinner so users understand what's happening instead of assuming the call broke. Sessions still re-queue from scratch on reconnect; full state persistence would be a separate, much bigger lift.
- TURN bandwidth quota alerting: polls Metered.ca's /api/v1/turn/current_usage every 30 minutes, surfaces yellow at 70% / red at 90%-or-overage. Email alert via the existing health-monitor pipeline + a dedicated TURN Quota panel on /admin/monitor. Closes the silent-failure mode where multi-cam dies for users behind strict NAT once the monthly cap is hit. Requires METERED_SECRET_KEY env var on Railway (separate from METERED_API_KEY); skipped silently if not configured.
- Audit cleanup: late-banned users on QUEUE_JOIN and ROOM_JOIN were checked with banned() (silent boolean) instead of isBannedGuard() (which actually disconnects the socket), so a banned user could keep a socket open and silently re-fire those events forever (rate-limited but still alive). Now disconnected on the first attempt like everywhere else. Dropped the dead isBanned getter from makeBanGuard plus the threading through index.js.
Adaptive WebRTC, Pro Arc Physics, and Choose-Your-Lane Landing
April 26, 2026
- WebRTC media constraints now adapt to the device + network. pickVideoConstraints() reads navigator.connection.effectiveType / saveData / downlink and navigator.userAgent at module load: slow networks (2g/3g, saveData, <1.5 Mbps downlink) get 480p/15fps, mobile browsers get 720p/24fps, desktop gets 1080p/30fps. Same fallback semantics as before — getUserMedia ideal/max still gracefully degrades if the camera can't hit the target.
- DEFAULT_AUDIO_CONSTRAINTS made explicit (echoCancellation / noiseSuppression / autoGainControl) so Safari and Firefox match Chrome's defaults instead of dropping to raw mic. Applied to startLocalStream and switchMic so swapping mics keeps the same processing.
- applyVideoSenderPrefs() sets degradationPreference: 'maintain-framerate' on every video sender right after addTrack (in startCall, addPartner, and onOffer) — for video chat smooth motion reads as 'good quality' even when bandwidth drops. setParameters persists across replaceTrack so camera flips and screen-share toggles inherit it.
- Camera tracks now get contentHint='motion', audio gets contentHint='speech' — encoder optimization hint, costs nothing, helps quality on weak uplinks.
- Camera-recovery bug fix: if the audio-only fallback fired once (camera denied) and the user later granted camera permission on retry, cameraUnavailable used to stick at true. Now setCameraUnavailable(false) once video tracks are confirmed.
- cameraConstraints() helper consolidates 5 duplicated getUserMedia constraint sites — switchCamera strategies 1/2/last-resort and stopScreenShare camera reacquire all read from the same source now.
- Major Maggots + Ka-Blam (Scorched Earth) get a new 'Pro Arc' bullet physics mode: 2-substep integration to reduce tunneling on fast shots, light drag (0.998/frame ≈ 12% velocity loss per second at 60fps), and damped wall ricochet that only reduces vx (no fake vy energy loss). Default stays 'Wrap Around' so existing rooms keep current feel; Pro is opt-in via the host's physics picker.
- Game picker on /chat 2-cam mode redesigned as a 4-column card grid showing each game's blurb plus a 'chill' tag for non-shooters (TicTacToe, Chess, Checkers, Dots & Boxes, Trap Star). Multi-cam picker keeps the pill row but appends ' · chill' to non-shooters so the distinction is visible at a glance.
- Landing page gets a 'Choose your lane' 4-button grid below the Forum link: 🎧 Solo, 👥 Buddy, 👥👥 Group, 🗣 Forum. New SessionMode type + preferredMode state + startSession() helper let users skip the mode-selection modal entirely when they pick a lane upfront — age gate fast-paths straight into chat.
- middleware.ts matcher now exempts robots.txt, sitemap.xml, and manifest.json from the geofence so non-Americas SEO crawlers and PWA install flows can still reach those files. Comment added to the config block so the next person knows why those three are listed.
Audit-Driven Hardening Pass + Admin Room Occupancy View
April 24, 2026
- WebRTC data channel throttle: per-peer cap of ~1 inbound message/sec on dc.onmessage so a flooding peer can't lock the main thread by re-render-storming setPartnerGeo. Tracker map is cleared alongside dataChannelsRef on removePartner, startCall, reset, and unmount.
- getUserMedia timeout: wrapped both the camera+audio attempt and the audio-only fallback in a 15s Promise.race so a hung getUserMedia can't deadlock startStreamLock and freeze every subsequent startLocalStream call. Lock now clears in a finally block on every path.
- /api/geo crash guard: spoofed x-vercel-ip-city: %A used to throw URIError out of decodeURIComponent and 500 the route. Wrapped both header decodes in a safeDecode helper that falls back to the raw value on bad percent-encoding.
- /api/og DNS rebinding SSRF blocked: the hostname allowlist ran against the URL string, but fetch() then DNS-resolved it — an attacker pointing public-looking.example.com at 169.254.169.254 (AWS metadata) or any RFC1918 IP slipped through. Now resolves the hostname via dns.promises.lookup before fetch and re-checks every returned IP, with the same guard applied to redirect targets. Pinned the route to the Node.js runtime so dns/promises is available.
- Bounds-check inbound peer events in Chess, TicTacToe, and DotsAndBoxes. Out-of-range coordinates from a malicious peer used to crash the receiver's React tree on the next render (Uncaught TypeError on undefined[idx]). Validate index/coord ranges and role/dir enums before applying each move; silently drop bad payloads.
- Flag clip filenames now include crypto.randomUUID() between the timestamp and reason segments — same-millisecond bursts no longer race on the same Supabase storage key with upsert:false, and filenames are no longer guessable.
- urlBase64ToUint8Array no longer crashes the push subscription flow on malformed VAPID keys. atob() throws DOMException on bad input; the helper now wraps the decode in try/catch and returns null. Subscribe sites already wrap in try/catch so a null applicationServerKey is handled gracefully.
- Server: don't ban the literal string "unknown". When a flagged socket disconnects between flag and submit, the live-socket lookup returns undefined and used to fall through to banIP("unknown") — pollutes the bans table and isn't actionable. Now prefers sessions.get(id).ip (recorded at connect time) before falling back to the live socket, and skips banIP entirely when no real IP is available.
- Server: ban check moved to io.use() handshake middleware. Doing await isBanned(ip) inside io.on("connection") raced with client emits — socket.io drops events arriving before any listener is attached, so an immediate queue:join right after connect could silently disappear during the await. Middleware blocks the handshake itself; handlers register synchronously after it passes. The mid-session "banned" flag stays for the room:join late-ban guard.
- Server: /stream-proxy hard-capped at 2 GB. A compromised or buggy allowed host could otherwise stream forever and tie up the socket. Reader is cancelled and response ended when the cap trips.
- Diagnostic log on queue_join is now always-on (not gated behind DEBUG=1). Every join prints socket id, ip, raw client mode, normalized server mode, vibes, and queue/session counts so "two online but not connecting" can be diagnosed from Railway logs without flipping an env var.
- Admin monitor: new "Where is everyone" panel between the stoplight and system checks. Pulls /admin/debug/sockets in parallel with /admin/status and groups every connected socket into rooms (Sesh, Buddy, Solo waiting, Private /code, in-queue with wait time, Idle). Hosts marked with a star, vibes shown when not "whatever". Best-effort — if the debug endpoint isn't available the panel hides and the rest of the monitor still works.
Removed Sentry + Debug Overlay; Socket Events Centralized; Server Helpers Extracted
April 24, 2026
- Pulled Sentry out of the entire stack — @sentry/nextjs from the Next app, @sentry/node from the Railway server, plus the four config files (instrumentation.ts, instrumentation-client.ts, sentry.edge.config.ts, sentry.server.config.ts) and the withSentryConfig wrapper in next.config.mjs. Reasoning: it only emitted on uncaught crashes (rare on this codebase), and the cost/control trade-off favored relying on existing console.error logging. Every captureError call site already had an adjacent console.error, so error visibility on Railway logs is unchanged.
- Removed the ?debug=1 WebRTC connection diagnostic overlay. The diagnostic ref store, ensureDebug helper, parseCandidateType regex, turnStatusRef, getDebugSnapshot getter, and the ConnectionDebug.tsx component are all gone — useWebRTC.ts is back to its pre-debug shape and ~110 lines lighter. The overlay was added 4/23 to chase the mesh-bandwidth freeze; now superseded.
- All 77 socket event names centralized in app/lib/socketEvents.json — single source of truth shared by the Next.js client (TS literal types via resolveJsonModule) and the standalone Node server (require). 224 string-literal occurrences across 6 files (useChat.ts, useWebRTC.ts, useInstagramStream.ts, server/index.js, server/handlers/moderation.js, server/handlers/streaming.js) replaced with EVENTS.NAME references. Same bytes on the wire (zero runtime impact), but now a typo in any event name fails at compile time instead of becoming a silent ICE-restart-never-fires bug 30 seconds into a session. Renaming an event becomes a one-file change.
- server/index.js shrunk from 2,158 → 1,868 lines (−13%) by extracting eight cohesive helper modules: server/modules/{log,metrics,ip-utils,geo,tokens,db,email,web-push}.js. Each module is a singleton with a clear contract — metrics owns counters + tracking helpers, db owns the Supabase client + ban/flag/appeal queries, email owns Resend + esc + send helpers, tokens owns secret loading + win-token/room-code generation, geo owns the 5000-cap IP→country cache, web-push owns VAPID setup + queue notification factory. Pure refactor: zero behavior change, no events renamed, no DB queries touched. Verified by full module-load test plus boot test (server reaches its listen() call without error).
- server/index.js shrunk further to 1,783 lines (−85 from previous pass, −17% cumulative) by extracting shared mutable state into server/state.js (16 collections: sessions, queue2, queueMulti, buddyQueue, formingRooms, privateRooms, upgradeableSessions, pendingJoinRequests, pendingKickVotes, approvedKicks, lastSyncedPartners, soloSessionTimers, socketToStream, activeStreams, flagCounts, plus MAX_CAM/MAX_QUEUE_SIZE/MODE constants and the syncSnapshot/setSession helpers tightly bound to that state). Skip-pair cooldown logic moved to server/lib/skip-cooldown.js (self-contained — recentSkips Map + wasRecentlySkipped + recordSkip). Private-room expiry/warn timers moved to server/lib/room-timers.js as a factory closing over io. The state module is the foundation for the next pass — matchmaking and group-room logic now have a clean import surface instead of reaching into top-level consts.
- server/index.js shrunk further to 1,575 lines (−208 from previous pass, −27% cumulative) by extracting two more lib modules. server/lib/session-sync.js now owns the throttled online-count broadcast plus both background heartbeats (15s session-sync detecting partner/tv changes, 30s queue prune removing dead sockets) — all three were anonymous setIntervals scattered across the top of index.js. server/lib/group-rooms.js now owns the buddy-queue + forming-room lifecycle for Smoking Buddy and Virtual Sesh modes (joinBuddyQueue, joinOrCreateFormingRoom, tryStartFormingRoom, leaveFormingRoom, plus the generateFormingRoomId helper). leaveCurrentContext stays in index.js for now since it crosses into matchmaking territory (calls removeFromQueue + endSession) — that gets cleaned up when the matchmaking module lands next.
WebRTC Connection Debug Overlay + YouTube Live Verification
April 23, 2026
- New ?debug=1 URL param on /chat opens a corner diagnostic panel for troubleshooting "matched but no connection" reports — primarily a remote-support tool. Shows live per-peer signaling / ICE / connection state, ICE candidate types gathered (host / srflx / relay), selected candidate pair on connect (host→host means same LAN, relay→relay means TURN is carrying the media), TURN reachability, offer→answer→connected timings, and socket status. "copy" button serializes the whole snapshot to clipboard for pasting into a bug report.
- Implementation is observation-only: all diagnostic data lives in a ref so state updates don't trigger re-renders on the hot path. The overlay component is gated behind the URL param and lazy-loaded, so users without ?debug=1 pay zero cost (no polling, no DOM, no extra JS). Socket, signaling, and ICE handlers are augmented — never replaced — so there's no behavior change for the non-debug path.
- Attempted fix for 4+ person room freezing on Samsung/Android (capture resolution cap + adaptive sender bitrate per peer count) was shipped then reverted within 20 minutes after a "2 online but no connection" report came in. Mesh-bandwidth bug remains open; new debug overlay is the tool to diagnose it safely before the next attempt.
- CH 420 (CLN) and CH 710 (Ask Chad GL) were showing stale replays instead of real live streams. YouTube's /channel/ID/live URL returns 200 with the channel landing page when no broadcast is active, and the first videoId in that HTML is typically a featured or past-live clip — the scraper was pinning to it. Fix chases the candidate videoId with a /watch?v= verify and requires "isLiveNow":true before embedding; otherwise the slot falls back to Off Air until the next 30-min refresh picks up a fresh broadcast.
TV Favorites, Sync-Drift Fix, Perf + Audit Pass
April 22, 2026
- TV Favorites (per-device, localStorage): ☆/★ button on the TV face toggles the current channel; the Guide gets a ★ N filter toggle that shows favorites-only with a running count; each row in the Guide has its own star so you can add/remove without changing channels. Stored by channel name (not index) so curator reorders don't break your list. No login required — persists on this browser.
- Fixed TV channel sync drifting apart after ~a minute. Server rate-limits tv:channel at 30/10s and silently drops excess — which also skips the session.tvChannel write, so the 15s session:sync heartbeat compared equal snapshots and never healed partners. Now: host emit is trailing-debounced by 300ms (burst surfing coalesces to the final channel), and the host re-emits its current channel every 20s as a keep-alive so any dropped event gets healed on the next tick.
- Leaderboard wrapped in React.memo + useMemo on the filtered list — stops re-rendering 10 rows every time the landing page ticks.
- /api/news swapped from force-dynamic to revalidate=120 so the Cache-Control header actually works and the three RSS feeds aren't fetched on every page view.
- /api/push-notify now returns 410 on expired subscriptions and 502 on generic send failures instead of always 200 — clients get real feedback when a notification fails to deliver.
- admin/monitor: CheckRow and history timeline keyed by stable id (check.name / h.ts) instead of array index, so React reconciliation doesn't fight the live-updating list.
- .env.local.example documents ALLOWED_ORIGINS, LEADERBOARD_GAMES, STOCK_SYMBOLS; server/.env.example documents SESSION_SECRET, METERED_API_KEY, METERED_APP_NAME. Previously 7 env vars were read by the code but missing from the examples.
- Minor version bumps: next, @sentry/nextjs, @supabase/supabase-js, hls.js, resend, tailwindcss, @tailwindcss/postcss, typescript, eslint-config-next, postcss, @next/third-parties. npm prune removed a handful of extraneous WASM transitives.
- Verified: .env.local and the Google OAuth JSON are properly gitignored (audit false-positive flagged them as 'committed' — they never appear in git history).
Audit Sweep: IPTV Auto-Health, Skip Cooldown, Desync Guard, Tune Button, Event-Name Standardization
April 19, 2026
- IPTV channel health is now auto-probed by the backend every 6 hours (HTTP GET with HLS-magic-byte check). Dead URLs are marked Off Air without manual curation. Results persist to a new Supabase iptv_health table so Railway redeploys don't erase what we've learned.
- First /api/iptv request after a cold start now blocks (up to 15s) on the initial probe, so users see a filtered guide instead of the raw curated list during warm-up. Subsequent requests fast-path.
- New Tune button on the TV remote — random hop to a healthy channel in the current group (falls back to any group if the current slot is Off Air). Brief static flash so the dial-turn feels like an old TV.
- Channel Guide now fully hides no-signal channels instead of showing them greyed out. Dead-via-playback channels (client-discovered this session) get dropped from the list the same way backend-probed Off Air slots already were, so every entry you see is a channel you can actually watch.
- 10-minute skip-pair cooldown: when two people skip each other, the server won't re-match them for 10 minutes. Keyed by IP so the cooldown survives reconnects. Applied across 1-on-1 match, multi-cam room formation, and upgrade-a-solo-room paths.
- endSession(socketId, reason) centralises the cooldown recording — explicit skip / buddy skip / group leave / room join all record "separation"; plain disconnects don't (so a network blip doesn't burn a pairing).
- Pending-join cleanup now runs even when the disconnecting socket had no session yet — previously a requester dropping before the vote finished left partners stuck on the vote popup until the 10s timeout fired silently.
- Game desync guard hardened in Ass and Ka-Blam: only player 0 responds to request_sync (deterministic authority in 3+ player rooms instead of a snapshot race). Both the request and the response are rate-limited to one per 2 seconds.
- WebRTC ICE-restart backoff is now exponential (0s → 3s → 8s over 3 attempts in a 30s window) instead of the old flat 5s cooldown. Mobile Wi-Fi handoffs recover faster without burning the restart budget on flaky networks.
- Private rooms emit a room:expiring:soon event 5 minutes before the 30-min TTL and a room:expired event on kill. Orange banner on the chat page so hosts can share the link to keep the room alive.
- Socket reconnect banner: if the socket drops mid-session, a blue "Reconnecting…" banner now shows instead of the UI silently going stale. Only fires once you've had at least one partner — initial connection still shows the normal status pill.
- In-session Vibes editor: new 🎲 Vibes button in the chat header opens the tag picker pre-populated with your current vibes. update_vibes event updates your session + queue entry so the next match uses the new tags without re-entering from the landing page.
- Socket event names standardised to namespace:action with colons (~190 renames). partner_left → partner:left, create_room → room:create, kick_vote_update → kick:vote:update, tv_channel_changed → tv:channel:changed, webrtc_offer → webrtc:offer, etc. Single-word events (matched, skipped, waiting, typing, message, flagged, banned) left alone.
- Code cohesion: emitMatch2() helper dedupes the setSession + "matched" + "host_changed" pattern across 3 call sites. joinQueueMulti and joinQueueMultiSkip collapsed into one function with a { tryExistingFirst } flag. useAudioDevices, useTileReorder, and useGameState hooks extracted from chat/page.tsx (−130 lines).
- Win-token leaderboard: verified existing impl already has 60s TTL + consume-once replay protection. Audit finding was a false positive — no changes needed.
Ass (formerly Major Maggots), Arrow-Key Movement, 5 New Terrains, American Public Feeds, IPTV Off-Air Cleanup
April 18, 2026
- Major Maggots renamed to Ass (🍑) across the chat games menu, leaderboard tab, settings header, and how-it-works page. File and backend leaderboard key (major-maggots) kept stable to avoid breaking existing wins.
- Maggots replaced with procedural butt-cheek bodies: two tinted hemispheres with center crack, ground shadow, top highlights, idle wobble. Damage tints the flesh redder; death pose still uses the original sprite.
- Cheeks now flap while walking. Each unit tracks its own walk energy + phase as a visual-only ref — cheeks alternate up/down, body sways forward into motion, and each cheek squashes opposite the other so they look like they're taking steps. Energy decays back to the gentle wobble when stopped.
- Arrow keys (←/→) now move the active maggot in Ass and the active tank in Ka-Blam during your move phase. Window-level keydown listener that skips when typing in inputs.
- Five new terrain variants for both Ass and Ka-Blam: Mountain (single tall central peak), Canyon (deep central dip with high cliffs), Islands (three separated humps over a low floor), Flatlands (gentle plain), and Spikes (jagged saw-tooth, lighter smoothing). Type is picked deterministically from the seed (seed % 6) so both clients render the same map. Map name shown top-right of the canvas.
- Post-sesh "Good sesh?" modal disabled — it was firing 30% of the time when a partner left and was proving too intrusive. Component wiring left in place for easy re-enable.
- Dev-only CSP: 'unsafe-eval' added to script-src in NODE_ENV !== production so Next 16 Turbopack source maps and React dev mode stop throwing console errors. Production CSP unchanged.
- IPTV channel deletion model reworked: instead of removing entries (which renumbered every channel above the gap), deleted channels are now replaced with Off Air placeholders so channel numbers stay stable. Channel up/down/auto-scan skip past Off Air slots, and the Channel Guide hides them entirely — users get jumped straight to the next working feed.
- route.ts now matches the trailing OFF_AIR fill by reference when assigning live RTMP streams, so a live stream can't overwrite an intentional Off Air placeholder.
- 29 channels marked Off Air based on user testing for dead feeds (CH 9, 10, 17, 21, 24, 26, 30, 31, 33, 41, 47, 56, 57, 67, then 70, 73, 74, 91, 92, 98, 109, 110, 111, 115, 120, 121, 122, 125, 131).
- New "American Public Feeds" channel group (38 streams) curated from iptv-org's us_local registry: DC.gov channels, LA CityView, Long Beach, Houston (HTV 1/2), Galveston, Atlanta, New Orleans, Mobile County schools, Palm Beaches, Miami Beach, Jacksonville Freedom Fountain cam, Pasco TV, White Plains, Greensboro, Champaign, Colorado Front Range cities (Lakewood, Fort Collins, Thornton, Golden, Loveland, Brighton, Littleton), Yuma AZ, Glendale AZ, plus several California city/community channels.
Connection Audit Fixes, Tile Drag on Mobile, +421 IPTV Channels, Lint Cleanup
April 18, 2026
- Kick-submit now requires a successful vote. New approvedKicks map on the server populates only when kick_vote_cast crosses the threshold — the initiator gets a single 60s window to submit, and the entry is deleted on consume. Previously any client in a multi-cam session could emit kick_submit directly; 3 unique reporters on the same target still triggered the auto-ban path with zero voting ever happening.
- ICE-restart watchdog no longer burns through its 3-attempt budget on InvalidStateError. triggerIceRestart now bails early when pc.signalingState !== "stable" (both on entry and after the cooldown), so glare / mid-renegotiation doesn't silently consume real restart slots on flaky mobile connections.
- Vote-approved joiner no longer loses their PCs to a status flap. useChatSession now latches hasStartedCallRef inside the joinApproved async loop, so a matched→connecting→matched bounce (after joinApprovedPartnerIds clears) doesn't re-fire startCall and close the just-built peer connections.
- Video-tile reorder works again on phones. Press-and-hold the middle of any cam square for ~0.5s to pick it up, then drag onto another square to swap. Button targets (mute, expand, kick-vote, pass-host, name edit) are excluded from drag so taps on those keep doing their normal thing.
- Fixed the underlying reason drag was silently failing: tiles were relying on default touch-action which let mobile browsers cancel the long-press as a scroll gesture before it armed. Now set touch-action: none on tiles (grid already has overflow-hidden, no scroll was expected there) and setPointerCapture on pointerdown so all subsequent move/up events stay pinned to the picked-up tile.
- IPTV library grew by 421 channels — all HTTPS, CORS-verified against the site's origin, and deduplicated against the existing 2000 entries. Pulled from iptv-org's categorized playlists (Movies, Sports, News, Music, Comedy, and supporting categories); filtered out geo-blocked, non-24/7, and user-agent-required streams that don't play in-browser.
- React 19 lint surface cleaned: 28 warnings — 0 errors, 0 warnings. Unavoidable patterns (game-event processing from peer sockets, client-only feature detection, fetch-then-clear-loading) get targeted eslint-disable comments with reasons. Ref-during-render assignments in RoomTV and ScorchedEarth moved into useEffect. Missing-deps fixed in useWebRTC.addPartner and two ShootMe effects.
Sentry Error Tracking, Stream CPU Fix, Audit Cleanup
April 14, 2026
- Sentry error tracking wired up: production-only, gated on DSN env vars so local builds skip the SDK entirely. Session replay enabled on errors only (10% sample) to keep bundle impact low. CSP updated with worker-src for Replay.
- Instagram stream no longer hangs the in-app TV: bitrate reduced 4Mbps → 1.8Mbps, canvas capture dropped from 30fps (frame-skipped) to native 15fps, and HLS lowLatencyMode disabled while streaming. CPU headroom restored — TV playback stays smooth while broadcasting.
- RoomTV HLS retry timer leak fixed: _retryTimer was stashed on the old HLS instance that gets nulled/replaced on retry, so unmount cleanup never cleared it. Moved to a dedicated ref.
- Canvas reframing pipeline deduplicated: three identical 720×1280 letterbox loops (room mode, camera mode, stream takeover) collapsed into a single startReframe() helper — net −53 lines.
- Removed orphan server emit (room_has_stream) that had no client listener, plus archive-debris directories (files/, files_extracted/).
Shoot Me (new multiplayer game), Cam-to-Cam Fix, CSP Hardening
April 13, 2026
- New game — Shoot Me: 8-player real-time top-down tank combat inspired by Atari Combat. First to 10 kills wins. Seeded maze with mirrored wall layout for fairness. WASD/arrows + space to fire, plus on-screen touch controls for mobile.
- Shoot Me physics options (host-selectable in lobby): Bouncy (bullets ricochet off walls up to 3 times) or Absorb (walls kill bullets on contact).
- Shoot Me netcode: each client owns its own tank and claims its own deaths. 5Hz snapshots with velocity included so receivers extrapolate smoothly between updates — keeps bandwidth below the game_event rate limit while motion stays fluid.
- Shoot Me security hardening: all peer-supplied numeric payloads validated with Number.isFinite + range bounds (NaN/Infinity injection blocked). Hit events require the bullet to exist locally AND be owned by the claimed shooter — peers can't fabricate kills on bullets that were never fired. Live bullet count per peer capped at 4 to prevent spam.
- Cam-to-cam connections restored: WebRTC ICE uses stun: and turn: URI schemes which weren't covered by the CSP's https: allowlist. Newer Chrome/Safari builds enforce connect-src for ICE endpoints. Added stun:/turn:/turns: to connect-src.
- Forum login fonts self-hosted: Google Fonts @import was blocked after CSP tightening. Migrated DM Sans + Playfair Display to next/font/google in a login-scoped layout — fonts now bundled at build time, zero external fetches.
- Server game_event rate limit raised 30/5s → 60/5s to give Shoot Me headroom for snapshots + fire bursts + hit events. Turn-based games unaffected.
- Leaderboard API playerCount cap raised 5 → 8 so Shoot Me winners can actually save to the leaderboard (tokens are signed with playerCount; a 5-cap clamp was rejecting 8-player tokens as signature-mismatched).
- Server now distinguishes games by seed-event payload shape (physics field → shoot-me, bulletPhysics/playerCount → major-maggots) so the correct player-cap is used when minting win tokens.
- Supabase schema: game_wins CHECK constraint expanded to include 'shoot-me'.
- Leaderboard landing page now has a Shoot Me tab alongside Ka-Blam and Major Maggots.
Stream Quality Overhaul, Code Audits, Multi-Cam Fix, Security Hardening
April 11, 2026
- Instagram camera stream no longer blurry: canvas reframing (720×1280 portrait) now applied to camera mode, room mode, and stream takeover — all three paths produce consistent quality.
- Stream encoding pipeline overhauled: client bitrate raised to 4Mbps VP8, server uses CRF 25 with ultrafast preset and 4Mbps maxrate cap. Eliminated dial-up effect caused by FFmpeg backpressure on constrained containers.
- Canvas draw loop optimized: switched from 60fps requestAnimationFrame to frame-skipping RAF (~30fps). Matches captureStream(30) sample rate, halves CPU usage. Fixed flicker caused by setInterval desync.
- Stream chunk rate limit raised from 10/sec to 15/sec — 100ms MediaRecorder interval was hitting the limit with zero headroom on timing jitter.
- Backpressure logging added to FFmpeg stdin — Railway logs now show when chunks are silently dropped.
- Multi-cam 3rd person fix: when a 3rd person joins, a race between addPartner and onOffer could leave the peer connection without local tracks (camera/mic). Now ensures tracks are always attached regardless of which code path creates the PC first.
- TV and radio restored: CSP connect-src and media-src opened for IPTV streams (1087 unique CDN domains) and radio-browser.info API. Script-src, img-src, and frame-src remain locked down.
- Backend monitor fixed: /admin/status crashed with ReferenceError (rateLimits not defined) after rate-limiting module extraction. Added getSizes() export. Monitor now handles non-JSON responses gracefully.
- Vibes config consolidated: single source of truth in app/lib/vibes.ts, imported by VibesBar and forum page. Eliminated duplicate lists.
- Stock symbols, ALLOWED_ORIGINS, and leaderboard games now configurable via env vars (STOCK_SYMBOLS, ALLOWED_ORIGINS, LEADERBOARD_GAMES) with backwards-compatible defaults.
- Push notification URL validation now derives allowed hosts from ALLOWED_ORIGINS instead of maintaining a separate hardcoded list.
- urlBase64ToUint8Array utility deduplicated: extracted to app/lib/base64.ts from 3 copy-pasted instances.
- News API: skip RSS items with empty or non-HTTP links. LinkPreview: added AbortController + 8s timeout. StockTicker: useMemo for interleaved items so memo(TickerContent) actually works.
- WebRTC geo data: validate value types on peer-sent data, not just key names. parseInt radix fix in leaderboard token verification.
- Forming room host transfer: validate new host is still connected before assigning. Dissolve room if all members disconnected.
- approveJoin: delete original partners key from upgradeableSessions (not filtered livePartners key) to prevent orphaned entries.
- Typing indicator no longer leaks across sessions — timeout clears automatically when leaving matched state.
- Instagram stream rapid start/stop guard: cleanupStream called before starting new stream to prevent canvas corruption.
- Security: x-forwarded-for validated against IP format regex before trusting. Buddy queue deduplication prevents duplicate entries on rapid skip.
- Video element cleanup: hidden canvas video elements now tracked in ref, paused and nulled on stream stop.