You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(live): de-dupe /sdk-info on resume + don't re-poll /broadcast on every tab focus
Two redundant-call fixes on the public live page:
1. /api/public/sdk-info fired 5x on resume, 1x on fresh load. refreshSdkInfoIfNeeded
set its dedupe key (_sdkInfoFetchedFor) only AFTER the await resolved, so the
burst of state updates on resume (REST seed + SSE state ticks + loadCurrentBatch),
each calling applyLiveModeBadge → refreshSdkInfoIfNeeded, all passed the guard
before the first fetch returned and each issued its own request. Share one
in-flight promise (_sdkInfoInflight) so concurrent callers coalesce to one fetch.
2. /api/broadcast fired on every tab focus. The visibilitychange handler called
checkBroadcastState unconditionally. Track the last poll time and only catch up
on focus when >= BROADCAST_POLL_MS (10s) has elapsed — so a quick tab flick makes
no extra call, while a return after a long hidden spell (when the interval was
throttled) still re-checks for a run that started meanwhile.
0 commit comments