mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
The force regenerate aborts its request at 45 s while the server's inline generation keeps running and usually writes the fresh briefing moments later. The old handling fired an error toast at the abort and re-read the old cache once; with a one hour staleTime and focus refetch off, nothing ever converged, so the page claimed failure while holding a finished assessment at arm's length. A timeout now enters a settling state: the hook remembers the cachedAt baseline it was showing and polls the read path on the existing bounded cadence (25 s, up to 10 attempts) until it can prove an outcome. Cache advanced past the baseline: the fresh payload lands and the success toast fires. A failure marker newer than the baseline, or the attempt cap: an honest error. While settling, the strip's button stays busy and says the assessment is still being prepared; no toast fires until the outcome is proven. Both poll reasons live in the nextAdvisorPollInterval seam, the verdict in resolveAdvisorSettle, the toast mapping in regenerateToastKind; all three are pure and pinned by unit tests. The contract is documented at both ends (hook and generate route). New copy in all six locales. Refs #786