From 3294525f4c7f0ce40f6af53339a584ca1760f199 Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Sat, 16 May 2026 11:15:18 -0500 Subject: [PATCH] fix(socket): prefer WebSocket transport for dashboard socket Mirrors the player-side fix in 1aee4f2 - skips the polling->WS upgrade dance that was causing the dashboard socket to flicker when Apply burst its fetch traffic. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/js/socket.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/js/socket.js b/frontend/js/socket.js index 069428a..f961bd4 100644 --- a/frontend/js/socket.js +++ b/frontend/js/socket.js @@ -4,7 +4,11 @@ const listeners = new Map(); export function connectSocket() { const token = localStorage.getItem('token'); dashboardSocket = io('/dashboard', { - auth: { token } + auth: { token }, + // Prefer WebSocket; fall back to polling on the same connect attempt. + // Mirrors the player-side fix in 1aee4f2 - skips the polling->WS upgrade + // dance that was causing the dashboard socket to flicker on Apply. + transports: ['websocket', 'polling'] }); dashboardSocket.on('connect', () => {