batches: make the preview and detail pages more resilient
Created by: LawnGnome
This changes the default refetch mode of the detail page to be cache-and-network
, which means that Apollo will fall back on its local cache when a network request fails. It also changes the polling query on the preview page to use Apollo with the same policy.
Fixes #29859 (closed).
Test plan
This is well covered by our storybook, and I've manually tested the behaviour by adding this code block to the frontend
external service handler to generate errors at will:
// Mount handlers and assets.
sm := http.NewServeMux()
sm.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) {
rw.Header().Set("Content-Type", "text/plain")
rw.WriteHeader(503)
rw.Write([]byte("server unavailable"))
})
return sm, nil