mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
fix: report stale and partial data in more tool answers
A sweep for the same pattern found more answers presented as current and complete: launches and satellite orbits served from a stale proxy cache, a regional aircraft fallback read as worldwide, license plate cameras trimmed or partly loaded, and a radio directory of popular stations read as every station. The launch and satellite sources now report the proxies' stale markers, and each answer says what it covers.
This commit is contained in:
1 parent
6a45a8f6a2
commit
e779432925
10 files changed
+185
-25
No files matched your search
@@ -185,7 +185,12 @@ test('radio stations match area and every search term', async () => {
|
||||
const jazz = await catalog.call('find_radio_stations', {
|
||||
query: 'jazz norwegian',
|
||||
});
|
||||
assert.equal(jazz.summary, '1 radio station matching "jazz norwegian".');
|
||||
assert.equal(
|
||||
jazz.summary,
|
||||
'1 radio station matching "jazz norwegian" (from a directory of 3 popular stations).',
|
||||
);
|
||||
assert.equal(jazz.data.directory_size, 3);
|
||||
assert.equal(jazz.data.stale, false);
|
||||
assert.equal(jazz.data.rows[0].distance_km, undefined);
|
||||
const classicalTexas = await catalog.call('find_radio_stations', {
|
||||
query: 'classical texas',
|
||||
@@ -220,3 +225,24 @@ test('malformed image results are a programming error', async () => {
|
||||
/malformed images/,
|
||||
);
|
||||
});
|
||||
|
||||
test('a stale or degraded radio directory is reported', async () => {
|
||||
const catalog = composeCatalog({
|
||||
tools: coreTools,
|
||||
services: {
|
||||
radio: {
|
||||
getDirectory: async () => ({
|
||||
stations: [],
|
||||
stale: true,
|
||||
degraded: true,
|
||||
}),
|
||||
},
|
||||
},
|
||||
});
|
||||
const result = await catalog.call('find_radio_stations', { query: 'jazz' });
|
||||
assert.match(
|
||||
result.summary,
|
||||
/the directory may be stale; the directory is incomplete right now\)\.$/,
|
||||
);
|
||||
assert.equal(result.data.degraded, true);
|
||||
});
|
||||
Reference in new issue
Block a user