fix(anime): cap outcome polling and upstream stalls by wall clock

- watchPlaybackOutcome now tracks a real deadline so slow property reads eat the timeout budget instead of extending it, and a zero probe interval still terminates
- stream strip proxy aborts upstream GETs that go silent for 15s instead of hanging mpv on that segment forever
- anime browser runtime drops a stream proxy that finishes starting after its bridge already died, instead of leaking a listener pointed at nothing
This commit is contained in:
2026-08-01 03:13:48 -07:00
parent 23d790d8f2
commit 45ca02a7d8
5 changed files with 120 additions and 58 deletions
+6 -1
View File
@@ -228,10 +228,15 @@ export function createAnimeBrowserRuntime(deps: AnimeBrowserRuntimeDeps) {
});
try {
stripProxy = await startStreamStripProxy({
const proxy = await startStreamStripProxy({
upstreamOrigin: () => sidecar?.baseUrl ?? handle.baseUrl,
log: deps.log,
});
// The bridge can die while the proxy is coming up, in which case onExit
// already ran and cleared `stripProxy`; adopting this one would leak a
// listening server pointed at a dead upstream.
if (sidecar === handle) stripProxy = proxy;
else void proxy.close();
} catch (error) {
// Playback still works for undisguised streams; log and carry on.
deps.log(`[anime-browser] stream proxy failed to start: ${describeError(error)}`);