Admin: an action's time left in the buffer starts far too long (18 s shown, 5 s real) #165

Closed
opened 2026-11-14 15:32:29 -05:00 by cmoriarty · 1 comment
Owner

What happens

The owner pressed Wrong game on a live game (Miami vs. Duke, 2026-11-14 at 15:19:16 EST, two players watching, production at 3a94153). The action worked: acestrims.pages.dev was rejected and givemestreams.cfd reached the players 9.9 s later. But its buffer step opened with far more time left than it took.

The action's record, read from GET /api/channels/{game_id}/operation after it ended:

Step Seconds
reject 0.0
load 5.0
buffer 4.8
sent at 15:19:26.5

eta_seconds_at_start was 18.5. The page shows that figure as "about 18 s left" and measures the bar's buffer part against it (bufferFill in frontend/src/admin/lanes.ts). So the time left fell about four times faster than a clock. By the history below it most likely read about 18 s, then about 10 s, then about 2 s, then done. Only the finished record was read; the readings in between were not recorded.

#163 asked for this display to show "ACCURATE information about what is happening".

Why the figure is too long

  • The estimate counts the buffer's clock only. Channel._operation_eta in backend/app/channel.py adds the time until the next release is due to the seconds of every older segment still held ahead of the new stream: one release per segment. Its own comment calls it "the longest it should take".
  • The buffer has a second way to release. Timeline.release lets the oldest segment go at once while the buffer holds more than its depth. After a landing the new stream's next segments keep arriving, and each one that puts the buffer over its depth pushes an old segment out early.
  • The channel's history shows it (/lanes, 3.5 s bins, 15:19:13 to 15:19:31). When the new stream loaded, two old segments were held (12.4 s, about 6.2 s each) and the next release was due about 6 s later, which makes the 18.5 s. Then releases came 1.9 to 2.0 s apart, where they had been 6.3 to 7.1 s apart, and the new stream's first segment was listed 4.8 s after the load. No filler was listed.

Every action that lands a stream takes this path (Channel._operation_loaded): Swap, Play, Wrong game, and Swap with no standby.

The idea

The step shows only what the server knows.

  • Known: how many older segments are still ahead of the new stream. The page already says it ("In the buffer, behind 2 older segments"). The bar's buffer part fills by that count: none gone, one gone, all gone.
  • Not known: when the source delivers its next segments, which is what ends the wait early. So the seconds are the most it can take, never a forecast.
  • Recommended: drop "about N s left" from this step and show its elapsed seconds, as every other step does. The other way is to keep the figure and say what it is ("at most 18 s"). The owner picks.

Done when

  • With the case above replayed in a test (two older segments ahead, and new segments arriving before the clock releases them), the page does not promise a time left: it shows the count of older segments ahead, and either no seconds left or a figure marked as the most it can take.
  • The bar's buffer part moves only forward and is full only when the new stream is listed to players.
  • The record says what its figures mean: eta_seconds and eta_seconds_at_start are described as the most it can take, or removed if nothing reads them.
  • The specs agree: the admin-page scenario "The buffer step fills as it goes" (it has "about 9 s left of a 12 s wait" and a quarter-filled bar) and the stream-supervision scenario for a swap behind one older segment.

Rides along

Seen after #161 and not fixed: at page widths near 1,000 px (a window of about 1,310 to 1,345 px) the Links table is 12 px wider than its column, so the Play column is cut at its right edge. In frontend/src/styles.css, .adm-links has flex: 5 1 560px while .adm-table.links has min-width: 640px. Done when the Play column is whole at every width, with the nothing-moves check of #163 still passing.

## What happens The owner pressed Wrong game on a live game (Miami vs. Duke, 2026-11-14 at 15:19:16 EST, two players watching, production at 3a94153). The action worked: acestrims.pages.dev was rejected and givemestreams.cfd reached the players 9.9 s later. But its buffer step opened with far more time left than it took. The action's record, read from `GET /api/channels/{game_id}/operation` after it ended: | Step | Seconds | | --- | --- | | reject | 0.0 | | load | 5.0 | | buffer | 4.8 | | sent | at 15:19:26.5 | `eta_seconds_at_start` was 18.5. The page shows that figure as "about 18 s left" and measures the bar's buffer part against it (`bufferFill` in `frontend/src/admin/lanes.ts`). So the time left fell about four times faster than a clock. By the history below it most likely read about 18 s, then about 10 s, then about 2 s, then done. Only the finished record was read; the readings in between were not recorded. #163 asked for this display to show "ACCURATE information about what is happening". ## Why the figure is too long - **The estimate counts the buffer's clock only.** `Channel._operation_eta` in `backend/app/channel.py` adds the time until the next release is due to the seconds of every older segment still held ahead of the new stream: one release per segment. Its own comment calls it "the longest it should take". - **The buffer has a second way to release.** `Timeline.release` lets the oldest segment go at once while the buffer holds more than its depth. After a landing the new stream's next segments keep arriving, and each one that puts the buffer over its depth pushes an old segment out early. - **The channel's history shows it** (`/lanes`, 3.5 s bins, 15:19:13 to 15:19:31). When the new stream loaded, two old segments were held (12.4 s, about 6.2 s each) and the next release was due about 6 s later, which makes the 18.5 s. Then releases came 1.9 to 2.0 s apart, where they had been 6.3 to 7.1 s apart, and the new stream's first segment was listed 4.8 s after the load. No filler was listed. Every action that lands a stream takes this path (`Channel._operation_loaded`): Swap, Play, Wrong game, and Swap with no standby. ## The idea The step shows only what the server knows. - **Known:** how many older segments are still ahead of the new stream. The page already says it ("In the buffer, behind 2 older segments"). The bar's buffer part fills by that count: none gone, one gone, all gone. - **Not known:** when the source delivers its next segments, which is what ends the wait early. So the seconds are the most it can take, never a forecast. - **Recommended:** drop "about N s left" from this step and show its elapsed seconds, as every other step does. The other way is to keep the figure and say what it is ("at most 18 s"). The owner picks. ## Done when - With the case above replayed in a test (two older segments ahead, and new segments arriving before the clock releases them), the page does not promise a time left: it shows the count of older segments ahead, and either no seconds left or a figure marked as the most it can take. - The bar's buffer part moves only forward and is full only when the new stream is listed to players. - The record says what its figures mean: `eta_seconds` and `eta_seconds_at_start` are described as the most it can take, or removed if nothing reads them. - The specs agree: the `admin-page` scenario "The buffer step fills as it goes" (it has "about 9 s left of a 12 s wait" and a quarter-filled bar) and the `stream-supervision` scenario for a swap behind one older segment. ## Rides along Seen after #161 and not fixed: at page widths near 1,000 px (a window of about 1,310 to 1,345 px) the Links table is 12 px wider than its column, so the Play column is cut at its right edge. In `frontend/src/styles.css`, `.adm-links` has `flex: 5 1 560px` while `.adm-table.links` has `min-width: 640px`. Done when the Play column is whole at every width, with the nothing-moves check of #163 still passing.
Author
Owner

Merged in PR #195 (merge 4d8b2c5), archived in fbe6270, live as fbe6270 since 2026-11-18 17:54Z.

  • The buffer step counts. It counts the older segments ahead of the new stream: how many when it began (ahead_at_start on the action's record) and how many are left.
  • The bar. It fills by that count, and is full only once the stream is sent.
  • The seconds. The step shows its elapsed seconds like every other step. "About N s left" is gone, and the record keeps no estimate (the ticket's recommended option).
  • The Play column. The Links section starts at its table's 640 px, so the column is no longer cut beside the log. Checked against the built stylesheet: before, the table was cut by 4 to 79 px at page widths of 910 to 1,030 px; now it never is.

Not seen live yet: a Swap or Wrong game showing the count.

Merged in PR #195 (merge 4d8b2c5), archived in fbe6270, live as fbe6270 since 2026-11-18 17:54Z. - **The buffer step counts.** It counts the older segments ahead of the new stream: how many when it began (`ahead_at_start` on the action's record) and how many are left. - **The bar.** It fills by that count, and is full only once the stream is sent. - **The seconds.** The step shows its elapsed seconds like every other step. "About N s left" is gone, and the record keeps no estimate (the ticket's recommended option). - **The Play column.** The Links section starts at its table's 640 px, so the column is no longer cut beside the log. Checked against the built stylesheet: before, the table was cut by 4 to 79 px at page widths of 910 to 1,030 px; now it never is. Not seen live yet: a Swap or Wrong game showing the count.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker#165
No description provided.