From a80229a9a53c342fde5a46839b4ed58a1b6f2b69 Mon Sep 17 00:00:00 2001 From: Rene Fichtmueller Date: Fri, 17 Jul 2026 07:22:47 +0200 Subject: [PATCH] fix: export RESULT_CACHE_TTL, missed by the Phase B cache-module extraction Real regression: /api/validate references RESULT_CACHE_TTL directly (validateCacheTTL ternary) for any ASN with >=1 announced prefix, but it was never added to server/caches/response-caches.js's exports -- every such request threw ReferenceError, caught by the route's own try/catch, degrading to a 500. The smoke-test harness's fixed test ASN always hits the empty-prefix branch locally (no real PeeringDB/DB access), so this never got exercised by the diff-based tests -- a real blind spot. Caught by running `eslint --rule no-undef` across server.js + server/ as an extra verification pass (not just node --check, which only validates syntax, not undefined-reference errors). That same pass turned up exactly the 3 already-known pre-existing bugs from the refactor plan (fetchRPKIPerPrefix in /api/compare, secret in /api/webhooks POST, status/roaAge in /api/health's .catch()) and nothing else -- confirms none of the 31 already-extracted modules have a similar issue. Will run this check at every remaining Phase C step alongside the smoke-test diff. Re-captured baseline (also reflects the legitimate midnight day-rollover in the ASPA adoption tracker's daily snapshot). --- server.js | 1 + server/__smoke__/baseline/baseline.json | 12 ++++++------ server/caches/response-caches.js | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index 4d8a4e0..2a7f4e5 100644 --- a/server.js +++ b/server.js @@ -97,6 +97,7 @@ const { responseCache, cacheGet, cacheSet, + RESULT_CACHE_TTL, CACHE_TTL_LOOKUP, CACHE_TTL_LOOKUP_DEGRADED, CACHE_TTL_DEFAULT, diff --git a/server/__smoke__/baseline/baseline.json b/server/__smoke__/baseline/baseline.json index 8f59af5..8788df7 100644 --- a/server/__smoke__/baseline/baseline.json +++ b/server/__smoke__/baseline/baseline.json @@ -3366,7 +3366,7 @@ "body": { "__non_json__": true, "status": 200, - "bodyLength": 7058 + "bodyLength": 7059 } }, "aspa-adoption-stats": { @@ -3374,12 +3374,9 @@ "body": { "period": "30d", "current": { - "date": "2026-07-16" + "date": "2026-07-17" }, "trend": [ - { - "date": "2026-06-16" - }, { "date": "2026-06-17" }, @@ -3469,10 +3466,13 @@ }, { "date": "2026-07-16" + }, + { + "date": "2026-07-17" } ], "meta": { - "total_snapshots": 79, + "total_snapshots": 80, "denominator": "atlas_visible_asns", "source": "rpki_cloudflare_feed" } diff --git a/server/caches/response-caches.js b/server/caches/response-caches.js index 35038f3..7565c59 100644 --- a/server/caches/response-caches.js +++ b/server/caches/response-caches.js @@ -94,6 +94,7 @@ module.exports = { responseCache, cacheGet, cacheSet, + RESULT_CACHE_TTL, CACHE_TTL_LOOKUP, CACHE_TTL_LOOKUP_DEGRADED, CACHE_TTL_DEFAULT,