Commit 09774a4
committed
fix(live): /live reacts to stop/done — freeze ETA + status, drop stuck "running"
Root cause (client-side): the server already forwards status:'stopped'/'done' to
/live (PUBLIC_EVENT_WHITELIST has 'state', PUBLIC_STATE_KEYS has 'status'), but
live.html's `case 'state'` merged the status without reacting — so the log-header
label stayed "running" and the per-second ETA ticker (gated only on _cb.startedAt,
never cleared) climbed forever, making /live look perpetually live after Stop.
Fix (reviewed — proper root-cause, gated on the real server status, no resume
regression since Resume re-emits running + a fresh batch:start that re-arms the
ETA):
- isRunLive() ticks the ETA ONLY while status==='running'. Paused states
(paused_balance/paused_internet) and terminal states freeze it.
- cbFreeze(status) on terminal status: clears startedAt + gap timer, drops the
pulse, sets the real label (stopped/complete/error/idle), resolves ETA to
00:00:00 / —.
- `case 'state'`: terminal → cbFreeze; running → setStatus; paused* → show a
friendly 'paused' label without freezing startedAt.
Also fixes the status-vocabulary drift the reviewer flagged (same class fixed in
the server guards/types earlier): match the real paused_balance/paused_internet
strings instead of the dead bare 'paused'. /live stays spectator-only; broadcast-
off behavior unchanged. Test suite green (188/31/45/35).1 parent 0e04a3e commit 09774a4
1 file changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1562 | 1562 | | |
1563 | 1563 | | |
1564 | 1564 | | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
1565 | 1588 | | |
1566 | 1589 | | |
1567 | 1590 | | |
| |||
1752 | 1775 | | |
1753 | 1776 | | |
1754 | 1777 | | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1755 | 1792 | | |
1756 | 1793 | | |
1757 | 1794 | | |
1758 | 1795 | | |
| 1796 | + | |
| 1797 | + | |
1759 | 1798 | | |
1760 | 1799 | | |
1761 | 1800 | | |
| |||
2257 | 2296 | | |
2258 | 2297 | | |
2259 | 2298 | | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
2260 | 2315 | | |
2261 | 2316 | | |
2262 | 2317 | | |
| |||
0 commit comments