From 3e59f8e85763224f128a26ad5c6636cc5b4bfa64 Mon Sep 17 00:00:00 2001 From: Brent G Date: Thu, 3 Sep 2026 07:16:10 +0000 Subject: [PATCH] =?UTF-8?q?fix(location):=20shorten=20agent=20location=20r?= =?UTF-8?q?e-check=20staleness=2024h=20=E2=86=92=202h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An agent that registered before the GeoIP databases existed sat Unverified for up to a day; a re-check is a sub-ms local lookup, and flap protection lives in REGION_CHANGE_STABILITY, so a 2h window is strictly better. 🤖 Built with SMT --- server/location.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/location.ts b/server/location.ts index b6a0cb1..9b26a2d 100644 --- a/server/location.ts +++ b/server/location.ts @@ -38,7 +38,12 @@ export interface LocationNextState { export const MAX_CITY_ACCURACY_KM = 100; export const CATALOG_MATCH_KM = 100; export const REGION_CHANGE_STABILITY = 3; -export const LOCATION_RECHECK_HOURS = 24; +// How stale an agent's last location check may get before a heartbeat re-runs +// detection (IP changes and pending hysteresis re-check regardless). A check is +// a sub-ms local mmdb lookup + one row update, so a short window is cheap; flap +// protection lives in REGION_CHANGE_STABILITY, not here. Was 24h — that made an +// agent registered before the GeoIP DBs existed sit Unverified for up to a day. +export const LOCATION_RECHECK_HOURS = 2; const PRIVATE_V4: Array<[number, number]> = [ // [network as u32, prefix length] — RFC1918 + loopback + link-local + CGNAT