Retry transient chart detail misses

This commit is contained in:
2569718930@qq.com
2026-06-14 07:42:18 +08:00
parent abe08de769
commit ad1e203adf
2 changed files with 39 additions and 2 deletions
@@ -299,6 +299,13 @@ export async function runTests() {
chartCanvasSourceIncludes(chartSource, "handleRetryDetail"),
"city detail charts should show stale cache first and expose a retryable unavailable state",
);
assert(
chartSource.includes("TRANSIENT_DETAIL_RETRY_DELAY_MS") &&
chartSource.includes("scheduleTransientDetailRetry") &&
chartSource.includes("fetchHourlyForecastForCity(city, { bypassLocalCache: true, resolution: targetResolution })") &&
chartSource.includes("!retryScheduled"),
"cold partial detail-batch misses should stay in loading state and retry cached detail once before showing unavailable",
);
const successfulHourlyDetailBlock =
/const applySuccessfulHourlyDetail = useCallback\([\s\S]*?\n \}, \[row\]\);/.exec(chartSource)?.[0] || "";
assert(