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) <noreply@anthropic.com>
This commit is contained in:
ScreenTinker 2026-05-16 11:15:18 -05:00
parent 2725ea9152
commit 3294525f4c

View file

@ -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', () => {