forked from KickTalkOrg/KickTalk
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
After waking the computer from suspend, chatroom tabs show incorrect live status highlighting (red border). Some tabs show as live when streamers are offline, and vice versa.
Steps to Reproduce
- Have multiple chatroom tabs open with mixed live/offline streamers
- Put computer to sleep/suspend
- Wake computer from suspend
- Observe that live status highlighting (red borders) no longer matches actual streamer status
Expected Behavior
Live status highlighting should automatically sync with actual streamer status after WebSocket reconnection.
Actual Behavior
Live status highlighting becomes out of sync:
- Some offline streamers show red "live" highlighting
- Some live streamers don't show red highlighting
- Manual page reload fixes the issue
Technical Details
Root Cause: The automatic reconciliation logic added in commit 969ce05 is not working properly after suspend/wake cycles.
Code Location: src/renderer/src/providers/ChatProvider.jsx:860-881
The one-shot reconciliation should trigger when WebSocket reconnects after suspend:
// One-shot reconcile on reconnect: if we've connected before for this
// chatroom, fetch fresh channel info once to sync live status/title in
// case events were missed during suspend.
const wasConnectedBefore = __wsConnectedOnce.get(chatroom.id) === true;
__wsConnectedOnce.set(chatroom.id, true);
if (wasConnectedBefore) {
setTimeout(async () => {
try {
const response = await window.app.kick.getChannelChatroomInfo(chatroom?.streamerData?.slug);
if (response?.data) {
const isLive = !!response.data?.livestream?.is_live;
get().handleStreamStatus(chatroom.id, response.data, isLive);
}
} catch (error) {
console.warn('[Reconnect Reconcile]: Failed to refresh channel info:', error?.message || error);
}
}, 1500);
}Potential Issues:
__wsConnectedOnce.get(chatroom.id)may not detect previous connections correctly after suspend- 1500ms timeout might be insufficient after system suspend/resume
- API calls during reconciliation may be failing silently
- WebSocket reconnection detection may not be working properly
Diagnostic Evidence
Console API check showing mismatched state vs reality:
simpless: API=true, CSS=false (should be red/live but isn't)
zuck: API=true, CSS=false (should be red/live but isn't)
4head: API=false, CSS=true (shows as live but actually offline)
xqc: API=false, CSS=true (shows as live but actually offline)
Environment
- Recent changes: Commit
969ce05"fix(navbar): keep live badge in sync via WS-only + reconnect reconcile" - WebSocket connection works normally (messages flowing)
- Manual reload fixes the issue immediately
Suggested Fixes
- Add more robust logging to reconciliation logic
- Increase timeout duration for post-suspend reconciliation
- Add fallback reconciliation on window focus events
- Add telemetry to track reconciliation success/failure rates
- Consider triggering reconciliation on visibility change events
Workaround
Manual page reload fixes the live status highlighting immediately.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working