A failed fallback is not tried again, and focus stays in the credits list as it redraws

This commit is contained in:
Sameh Khamis committed 2026-11-10 18:57:47 -08:00
1 parent e440f3dddb
commit df8728d0ad
4 files changed
+49 -5

No files matched your search

+9 -3
View File
@@ -263,9 +263,15 @@ export class MapSourceController {
this._onError?.(this._lastError, recovery);
}
}
// A stack that stays after the failed switch (and a failed recovery)
// still falls back on its tile failures, heard for this switch.
if (!recovered && this._imageryLayer && this._activeResolution) {
// A stack that stays after a failed choice (and a failed recovery)
// still falls back on its tile failures, heard for this switch. A
// failed fallback is not tried again on the next failures.
if (
!recovered &&
!automatic &&
this._imageryLayer &&
this._activeResolution
) {
this._removeImageryErrorListener?.();
this._removeImageryErrorListener = null;
this._watchProvider(this._activeResolution, gen);
+8
View File
@@ -271,6 +271,14 @@ test('a stack kept after a failed switch and a failed recovery still falls back
for (const listener of [...tileErrors]) listener({});
for (let i = 0; i < 20; i++) await new Promise((r) => setTimeout(r, 0));
assert.ok(osmTries > tries, 'its tile failures still try its fallback');
// That fallback failed too: the next failures do not try it again.
const retried = osmTries;
for (let n = 0; n < 3; n++) {
for (const listener of [...tileErrors]) listener({});
for (const listener of [...tileErrors]) listener({});
for (let i = 0; i < 20; i++) await new Promise((r) => setTimeout(r, 0));
}
assert.equal(osmTries, retried, 'no retry storm');
} finally {
console.warn = warn;
controller.destroy();