From 3263fe6ff13657466356090e07a8d5328ab38161 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 12 Sep 2026 15:48:47 -0700 Subject: [PATCH 1/2] fix(search): cancel active lookup when controls are disposed --- CHANGELOG.md | 3 +++ docs/CURRENT-STATE.md | 2 +- src/cameraHandoff.test.mjs | 6 ++++++ src/ui.js | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce777c00e..f7a9828dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ of current runtime behavior, see [`docs/CURRENT-STATE.md`](docs/CURRENT-STATE.md ## [Unreleased] +- Cancel the active location lookup when its controls are disposed. + + ### Fixed - GBFS rejects upstream redirects, caps streamed responses at 5 MiB, and keeps diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 2e4371357..e54ee30d2 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -2513,7 +2513,7 @@ Only valid answers and definitive misses enter bounded caches; malformed replies HTTP refusals and outages remain retryable. Searches share a 12-second total deadline, with Photon requests capped at six seconds each. Caller/application cancellation stops retries and late cache writes. Replacing a location search -cancels the previous lookup. Photon uses a soft proximity bias, up to five +cancels the previous lookup; disposing its controls cancels the active lookup. Photon uses a soft proximity bias, up to five candidates, and an unbiased retry for name mismatches. Invalid/wrapped bounds are omitted rather than framing the wrong part of the globe. diff --git a/src/cameraHandoff.test.mjs b/src/cameraHandoff.test.mjs index e7d5b0268..e65d44977 100644 --- a/src/cameraHandoff.test.mjs +++ b/src/cameraHandoff.test.mjs @@ -412,3 +412,9 @@ test('vessel and fire layers announce valid clicks and never fly cameras', () => 'selectAndFocusFire(carded)', ], 'fire sibling ownership'); }); + + +test('disposal aborts the active location lookup', () => { + const disposal = ui.slice(ui.indexOf(' async dispose()')); + assert.match(disposal, /this\._locationSearchController\?\.abort\(\)/); +}); diff --git a/src/ui.js b/src/ui.js index 7a1b911d6..300f4cc5b 100644 --- a/src/ui.js +++ b/src/ui.js @@ -4236,7 +4236,6 @@ export class StyleManager { }; if (panelId === 'control-panel') { this._cancelMapSourceFocus?.(); - this._locationSearchController?.abort(); this._cancelMapSourceFocus = cancelMapSourceFocus; } @@ -10319,6 +10318,7 @@ export class StyleManager { this._globalStatusNotice = null; if (this._globalLoadingStatus) this._globalLoadingStatus.hidden = true; this._disposed = true; + this._locationSearchController?.abort(); this._cancelMapSourceFocus?.(); // Revoke persistence/hash authority before teardown can emit manager changes. this._layerStateCoordinator?.destroy(); From 48a2f06fa2800a9105f774fd39f0e6edd2d5f466 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 12 Sep 2026 15:49:25 -0700 Subject: [PATCH 2/2] test: retain existing teardown assertions for cleanup follow-up --- src/cameraHandoff.test.mjs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/cameraHandoff.test.mjs b/src/cameraHandoff.test.mjs index e65d44977..e7d5b0268 100644 --- a/src/cameraHandoff.test.mjs +++ b/src/cameraHandoff.test.mjs @@ -412,9 +412,3 @@ test('vessel and fire layers announce valid clicks and never fly cameras', () => 'selectAndFocusFire(carded)', ], 'fire sibling ownership'); }); - - -test('disposal aborts the active location lookup', () => { - const disposal = ui.slice(ui.indexOf(' async dispose()')); - assert.match(disposal, /this\._locationSearchController\?\.abort\(\)/); -});