Files
hyperframes/packages
Vance IngallsandClaude Opus 5.5 a88751d9d6 fix(studio): a thumbnail reader forgets a start's failures after a minute (#6642)
* fix(studio): a thumbnail reader forgets a start's failures after a minute

A pooled thumbnail reader lives for as long as clips keep asking it, and each start
byte has a retry budget of two. That budget never reset, so two transient failures at
one start early in a session made a third, twenty minutes later after the cache evicted
it, give up at once: the reader retired and the clip showed an error.

A start's failures now count for a minute. One bout of retries (8 s stalls, 0.5 s and
1 s waits) fits inside it, so a start that keeps failing still gives up; one met again
much later starts afresh. Clearing the count when a read from that start delivers bytes
would not do: a server that ignores Range sends bytes 0 onward again before it breaks at
the same byte, and would retry forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(studio): the start-failure window says what it is in its name, not a comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(studio): a start's retry budget resets when a read from it ends cleanly, not after a minute

The one-minute window only held while each attempt took under a minute. An attempt has
no limit before its answer, and a body that keeps sending never stalls, so a server that
ignores Range, sends slowly and breaks past a minute re-downloaded from 0 forever.

A start's failures are now forgotten when a read from it ends cleanly: its body finishes,
or mediabunny cancels it at its target. A server that breaks before the target never ends
a read cleanly, so its budget still runs out, however slowly it fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(studio): a read mediabunny stops at its target ends cleanly and resets its start's budget

mediabunny's UrlSource never cancels the body: once a read reaches its target, _runWorker
aborts the signal it passed in, and the pending pull fails with an AbortError. So the reset
on cancel never fired, and any open bytes=N- read stopped at its target kept its start's
failures.

The request now listens on its own signal, which follows mediabunny's and is unlinked once
the read ends: an abort while live counts as a clean end only when mediabunny's signal is
the one aborted, never a stall or a dispose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 10:15:28 +00:00
..
2026-10-28 09:30:08 +00:00
2026-10-28 09:30:08 +00:00
2026-10-28 09:30:08 +00:00
2026-10-28 09:30:08 +00:00
2026-10-28 09:30:08 +00:00
2026-10-28 09:30:08 +00:00
2026-10-28 09:30:08 +00:00