From 07f61f8ca96c9dd19706cd5f373c934b295e87d3 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 17 May 2026 19:48:09 +0800 Subject: [PATCH] Bump city detail cache for chart rebuild --- .../__tests__/stableServerRefreshPolicy.test.ts | 6 ++++++ frontend/lib/dashboard-client.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/components/dashboard/scan-terminal/__tests__/stableServerRefreshPolicy.test.ts b/frontend/components/dashboard/scan-terminal/__tests__/stableServerRefreshPolicy.test.ts index 902ccdc9..4233a917 100644 --- a/frontend/components/dashboard/scan-terminal/__tests__/stableServerRefreshPolicy.test.ts +++ b/frontend/components/dashboard/scan-terminal/__tests__/stableServerRefreshPolicy.test.ts @@ -20,6 +20,7 @@ export function runTests() { "dashboard", "ScanTerminalDashboard.tsx", ); + const dashboardClientPath = path.join(projectRoot, "lib", "dashboard-client.ts"); const airportEvidencePath = path.join( projectRoot, "components", @@ -30,6 +31,7 @@ export function runTests() { const querySource = fs.readFileSync(queryPath, "utf8"); const dashboardSource = fs.readFileSync(dashboardPath, "utf8"); + const dashboardClientSource = fs.readFileSync(dashboardClientPath, "utf8"); const airportEvidenceSource = fs.readFileSync(airportEvidencePath, "utf8"); assert( @@ -49,4 +51,8 @@ export function runTests() { !airportEvidenceSource.includes("busan:"), "airport evidence must only expose configured focused runways, not all runway observations", ); + assert( + dashboardClientSource.includes('CACHE_KEY = "polyWeather_v2_chart_full_day"'), + "city detail cache key must be bumped so old partial chart detail caches are not reused", + ); } diff --git a/frontend/lib/dashboard-client.ts b/frontend/lib/dashboard-client.ts index 3b542e8a..f422f674 100644 --- a/frontend/lib/dashboard-client.ts +++ b/frontend/lib/dashboard-client.ts @@ -15,7 +15,7 @@ import { } from "@/lib/backend-api"; import { formatHttpErrorMessage } from "@/lib/http-error"; -const CACHE_KEY = "polyWeather_v1"; +const CACHE_KEY = "polyWeather_v2_chart_full_day"; const CACHE_TTL_MS = 30 * 60 * 1000; const SCAN_TERMINAL_CLIENT_TIMEOUT_MS = 35_000; const CITY_DETAIL_CLIENT_TIMEOUT_MS = 35_000;