mirror of
https://github.com/immich-app/immich
synced 2026-08-22 13:13:05 +00:00
fix(web): cancel video preview fetch when bind:this is cleared early
In Svelte 5.53.9, `bind:this` is now cleared earlier in the unmount
sequence ("better bind:this cleanup timing"). The video thumbnail's
$effect was relying on the old order to read the bound `player` element
and clear its `src` to abort the in-flight `/api/assets/{id}/video/playback`
range request — but the bind is now `undefined` by the time the effect
runs, so the cleanup is silently skipped. The detached <video> keeps
its src, and Firefox does not abort an in-flight media fetch when the
element is detached/GC'd. Long-lived 206 range requests then saturate
Firefox's 6-connection HTTP/1.1 per-host limit and freeze the timeline
(see #27585).
Capture the player reference inside the effect and tear down via the
effect cleanup return — Svelte runs the prior cleanup (with the captured
ref) before `bind:this` is cleared. Use the canonical
`pause() / removeAttribute('src') / load()` sequence which actually aborts
the fetch in Firefox, even on a detached element.
Fixes #27585
Change-Id: I4d9fba859955f5c54f603c345e61d4206a6a6964
|
||
|---|---|---|
| .. | ||
| __mocks__ | ||
| actions | ||
| assets | ||
| attachments | ||
| components | ||
| elements | ||
| managers | ||
| modals | ||
| services | ||
| stores | ||
| utils | ||
| commands.ts | ||
| constants.ts | ||
| i18n.spec.ts | ||
| index.spec.ts | ||
| index.ts | ||
| route.spec.ts | ||
| route.ts | ||
| types.ts | ||
| utils.spec.ts | ||
| utils.ts | ||