Dungeon texture cache treats a failed preload as complete #1045

Closed
opened 2026-08-13 05:23:59 +00:00 by spikerj · 1 comment
Owner

TextureCache.preloadAll swallows per-texture failures (console.warn + continue) and then unconditionally sets isPreloaded = true.

A later preloadAll therefore returns immediately, so a 404'd wall/floor/tent never retries for the rest of the session. get() stays undefined; getOrLoad may start a sync loader that also fails silently.

Pinned by texture-cache.spec.ts ("preloadAll still marks isPreloaded after a per-texture failure and does not retry").

try {
  await this.loadTexture(path);
} catch (error) {
  console.warn(`Failed to preload texture: ${path}`, error);
}
// ...
this.isPreloaded = true;
`TextureCache.preloadAll` swallows per-texture failures (`console.warn` + continue) and then unconditionally sets `isPreloaded = true`. A later `preloadAll` therefore returns immediately, so a 404'd wall/floor/tent never retries for the rest of the session. `get()` stays undefined; `getOrLoad` may start a *sync* loader that also fails silently. Pinned by `texture-cache.spec.ts` ("preloadAll still marks isPreloaded after a per-texture failure and does not retry"). ```ts try { await this.loadTexture(path); } catch (error) { console.warn(`Failed to preload texture: ${path}`, error); } // ... this.isPreloaded = true; ```
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.