fix(display): keep one object URL per cached slide, and give them back

The Cache Storage media cache minted a new object URL on every lookup
and never revoked any. Every state refresh looks up every cached slide,
so a running display pinned one more blob per slide per refresh until
the browser refused its requests with net::ERR_INSUFFICIENT_RESOURCES.
It then showed its offline banner on a working network. Two tabs leaked
twice as fast, and real photographs fill blob storage far sooner than
test slides.

Each cache entry now has exactly one object URL:
- every lookup reuses it;
- pruning or replacing the entry revokes it;
- release(), new on SignageMediaCache, revokes all of them, and the
  controller calls it on stop once the stage is gone.

Two lookups of one slide racing each other keep the first URL and make
no second one. The in-memory cache has nothing to give back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ekklesia
2026-10-05 21:45:19 -05:00
co-authored by Claude Opus 5.5
parent 1c6c9ccc1f
commit 607f375809
3 changed files with 52 additions and 4 deletions
+2
View File
@@ -715,6 +715,8 @@ export function createDisplayController(options: DisplayControllerOptions): Disp
exitOffline();
await stage?.destroy();
stage = undefined;
// After the stage is gone, so nothing on screen still points at a released URL.
media.release();
},
};