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:
@@ -140,6 +140,18 @@ export class TileScheduler {
|
||||
if (changed) this.#lastDesired = []
|
||||
}
|
||||
|
||||
/**
|
||||
* True while any wanted tile still has to settle on this pass (queued, loading, or not yet
|
||||
* asked). A stored `error` is *terminal for this pass*: it is only retried on a new window or
|
||||
* after `retryFailed()`, so it must not keep a readiness probe waiting forever.
|
||||
*/
|
||||
isPending(urls: readonly string[]): boolean {
|
||||
return urls.some(url => {
|
||||
const status = this.#states.get(url)
|
||||
return status === undefined || status === 'queued' || status === 'loading'
|
||||
})
|
||||
}
|
||||
|
||||
/** True when every wanted tile settled with an `ok` or `denied` answer. */
|
||||
isComplete(urls: readonly string[]): boolean {
|
||||
return urls.every(url => {
|
||||
|
||||
Reference in New Issue
Block a user