From fff8a8382b4130f8e51f03af9839cc2c9ba82f01 Mon Sep 17 00:00:00 2001 From: TheFozid Date: Mon, 3 Aug 2026 14:47:33 +0100 Subject: [PATCH] extend more info timeout to 30s --- Cargo.lock | 2 +- Cargo.toml | 2 +- frontend/app.js | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f2a7d26..1397bd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "rs_maps" -version = "0.3.2" +version = "0.3.3" dependencies = [ "anyhow", "argon2", diff --git a/Cargo.toml b/Cargo.toml index de1e7a0..f8bbc22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ # Cargo.toml [package] name = "rs_maps" -version = "0.3.2" +version = "0.3.3" edition = "2021" [dependencies] diff --git a/frontend/app.js b/frontend/app.js index 8e9ed26..74031fa 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -36,9 +36,10 @@ const OVERPASS_ENDPOINTS = [ 'https://overpass.private.coffee/api/interpreter', ]; -// Past this, move on to the next mirror. A single-object lookup that hasn't -// answered in 8s isn't going to. -const OVERPASS_TIMEOUT_MS = 8000; +// Overpass queues requests when busy — a trivial single-object lookup has been +// observed taking over a minute before returning a perfectly good 200. 30s is +// the most that's reasonable to make someone wait; past that, give up quietly. +const OVERPASS_TIMEOUT_MS = 30000; const COLOURS = ['#4E9C6B', '#D2467F', '#E2A93C', '#4E8FC9', '#B07BD4', '#D3574B']; const DEFAULT_COLOUR = COLOURS[0]; @@ -705,7 +706,9 @@ async function fetchOsmTags(osmType, osmId) { const short = OSM_SHORT[osmType]; if (!short) return null; - const query = `[out:json][timeout:10];${short}(${osmId});out tags;`; + // Server-side budget matched to ours, so it sheds the request rather than + // holding it in a queue we've already stopped waiting on. + const query = `[out:json][timeout:30];${short}(${osmId});out tags;`; let lastError = null; for (const endpoint of OVERPASS_ENDPOINTS) { @@ -907,12 +910,11 @@ function showSearchHit(hit) { slot.replaceChildren(node); more.remove(); } catch { + // Overpass being busy is routine and not worth interrupting anyone + // over. The button simply comes back so it can be pressed again; + // the reason stays in the console. more.disabled = false; more.textContent = 'More details'; - // Every mirror was busy or unreachable. This is a load problem at - // their end, not missing data — worth saying so, since retrying in a - // minute usually works. - toast('OpenStreetMap details are busy — try again shortly', true); } popup.update(); // re-measure after the content grew });