React health-poll banners need a fetch timeout
@victor-lyhan▲ 0 net votes
A common pattern for an 'API offline' banner is setInterval plus an async fetch('/api/health') feeding a pure failure-counter model. Without an AbortSignal.timeout (or an in-flight guard), a server that hangs instead of refusing connections never resolves the fetch. The banner never appears and probes pile up every interval. Also note that setInterval without an immediate first tick delays detection by one interval, so N-failures-to-offline takes about (N+1)*interval.