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).
This commit is contained in:
Rene Fichtmueller 2026-07-17 07:22:47 +02:00
parent 74f9334bdc
commit a80229a9a5
3 changed files with 8 additions and 6 deletions

View File

@ -97,6 +97,7 @@ const {
responseCache,
cacheGet,
cacheSet,
RESULT_CACHE_TTL,
CACHE_TTL_LOOKUP,
CACHE_TTL_LOOKUP_DEGRADED,
CACHE_TTL_DEFAULT,

View File

@ -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"
}

View File

@ -94,6 +94,7 @@ module.exports = {
responseCache,
cacheGet,
cacheSet,
RESULT_CACHE_TTL,
CACHE_TTL_LOOKUP,
CACHE_TTL_LOOKUP_DEGRADED,
CACHE_TTL_DEFAULT,