mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
feat(#76): harvest request-scoped availability and freshness truth
Backend-only re-cut of the #76 availability work onto main, stacked on the canonical Weekend Context API. Adds request-scoped freshness reporting so aggregate responses cannot report fresh when a component is stale, plus local-first driver summary resolution and cache/pacing truth. The frontend half of #76 is deliberately excluded: it is built on the Weekend shell that failed owner review, including the full-width Partial banner treatment. Availability presentation is re-cut with the shell in #89. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ func (s *Server) handleRaceHub(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if !s.hasLocalQuery() {
|
||||
markDataResponse(w, "none", "limited")
|
||||
writeJSON(w, emptyRaceHub(sessionKey))
|
||||
return
|
||||
}
|
||||
@@ -26,6 +27,14 @@ func (s *Server) handleRaceHub(w http.ResponseWriter, r *http.Request) {
|
||||
writeError(w, err, http.StatusInternalServerError, false)
|
||||
return
|
||||
}
|
||||
switch hub.Source {
|
||||
case query.ResponseSourceNone:
|
||||
markDataResponse(w, "none", "limited")
|
||||
case query.ResponseSourcePartial:
|
||||
markLocalResponse(w, true)
|
||||
default:
|
||||
markLocalResponse(w, false)
|
||||
}
|
||||
writeJSON(w, hub)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user