v0.5.110: stop carrying stale live badges; probe live status in local serve.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
voson
2026-07-30 01:11:13 +08:00
co-authored by Cursor
parent d6212169af
commit fe1b13b7c1
10 changed files with 125 additions and 56 deletions
+8 -6
View File
@@ -4749,9 +4749,9 @@ function syncStreamerCardLive(card, row) {
/**
* Visit-triggered live refresh: the Pages Function coalesces concurrent
* visitors through a 5-minute edge cache. Local `serve_relations.py` returns
* an empty stub (no probing), so that path keeps the data.json is_live
* fallback. Fires at most once per page load.
* visitors through a 5-minute edge cache; the local development server uses
* the same platform probes with a short in-memory cache. Fires at most once
* per page load.
*/
let liveStatusFetched = false;
@@ -4776,9 +4776,11 @@ function refreshStreamerLiveStatus() {
for (const row of rows) {
const cell = row && row.id ? probed[row.id] : null;
if (!cell || typeof cell.is_live !== "boolean") continue;
if (cell.stale) console.info(`live-status: ${row.id} using stale carry-over`);
if (row.is_live !== cell.is_live) {
row.is_live = cell.is_live;
// A failed/stale probe is unknown, never evidence that a room is live.
const isLive = cell.stale ? false : cell.is_live;
if (cell.stale) console.info(`live-status: ${row.id} probe stale; hiding badge`);
if (row.is_live !== isLive) {
row.is_live = isLive;
changed = true;
}
}