fix(client): make data-tiles ready when the pass completes

A transient tile load error is terminal for the current window (retried only on
a new window or a reconnect), but data-tiles treated it as never settled, so one
host hiccup left it at 'loading' forever and every e2e readiness wait hung
(audit.test.mjs timed out under a parallel lane). TileScheduler.isPending() now
reports loading only for queued/in-flight tiles; ready means the pass is done.
Proven by aborting one tile request: the wait timed out before, passes after.
Unit-tested at the scheduler seam.
This commit is contained in:
2026-11-21 18:19:47 +01:00
parent ac5a6ac8dc
commit 9c05bb1f46
6 changed files with 63 additions and 32 deletions
+6 -3
View File
@@ -134,9 +134,12 @@ change them only if a slice needs a new *core* event, and say so in the PR.
remembers a `403`/`404` as `denied` forever: the gate has said "not yours", so it is never retried
in a loop. A transient failure is retried only on a new window or after a reconnect (`hello`).
The decoded-texture cache is module-level and keyed by URL, so a reconnect keeps every tile and
the page makes no new tile request. `data-tiles` is `ready` once every wanted tile has settled
(`ok` or `denied`); `data-tile-requests` counts image attempts (plus the single status fetch used
to classify an image error).
the page makes no new tile request. `data-tiles` is `ready` once the current pass is complete:
every wanted tile has a terminal answer (`ok`, `denied`, or a stored transient `error` that waits
for a new window or a reconnect). A transient `error` is deliberately not pending, otherwise one
host hiccup would hold the flag at `loading` and hang every e2e readiness wait; the hole it leaves
fills on the next window or reconnect. `data-tile-requests` counts image attempts (plus the single
status fetch used to classify an image error).
- **Why `<img>` and not `fetch` + `createImageBitmap`:** the browser's image loader does the
fetch/decode off the JS hot path; one `onload` per tile is the cheapest way to put the ~480 tiles
of a phone viewport on the GPU. A failed image is classified once with `fetch`, which is where the