From f86d1c329634e4a365d6d7fa74e5bda0250dda2e Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Mon, 5 Oct 2026 19:22:59 -0700 Subject: [PATCH] fix: recover near-view places through the application's place search --- src/locations.js | 1 + src/locations.test.mjs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/locations.js b/src/locations.js index c9df123e8..02bd853fb 100644 --- a/src/locations.js +++ b/src/locations.js @@ -841,6 +841,7 @@ export async function searchAndFlyTo(viewer, query, options = {}) { query, result && !outcome.fallbackUsed ? { lat, lon: lng } : null, signal, + placeSearch, ); signal?.throwIfAborted(); if (recovered) { diff --git a/src/locations.test.mjs b/src/locations.test.mjs index 35db0188e..c225488a3 100644 --- a/src/locations.test.mjs +++ b/src/locations.test.mjs @@ -599,6 +599,21 @@ test('search without an authority hook preserves the existing caller contract', assert.equal(viewer.flights.length, 1); }); +test('near-view recovery searches through the application place search', async () => { + // Recovery must use the place search the application configured, not the module default. + const viewer = stubViewer(); + const placeSearch = createStandalonePlaceSearch({ resolveApiKey: () => 'test-key' }); + let received = null; + await runSearch(viewer, { + placeSearch, + recoverNearView: async (...args) => { + received = args[4]; + return null; + }, + }); + assert.equal(received, placeSearch); +}); + test('a precise search without an outline frames against the resolved ground, not sea level', async () => { // Camp Mabry field report: with no detailed outline (no configured Overpass) // framing used the 250 m landmark range from a sea-level target, and the eye