more code

This commit is contained in:
developer committed 2026-09-27 11:34:26 +00:00
1 parent f24fd63e9a
commit ee72257c64
29 files changed
+5636 -440

No files matched your search

+11 -2
View File
@@ -417,6 +417,8 @@ export function streamLogs(handlers: LogStreamHandlers): () => void {
let backoff = RECONNECT_MIN_MS
let timer: ReturnType<typeof setTimeout> | undefined
let attempt = 0
// One error report per outage streak: a flaky link must not toast every 15s.
let reported = false
const open = (): void => {
if (stopped) return
@@ -447,11 +449,15 @@ export function streamLogs(handlers: LogStreamHandlers): () => void {
const message = res.ok
? 'the live log stream is not supported by this browser'
: `the live log stream failed with HTTP ${res.status}`
handlers.onError(message)
if (!reported) {
reported = true
handlers.onError(message)
}
schedule()
return
}
reported = false
attempt = 0
backoff = RECONNECT_MIN_MS
handlers.onOpen()
@@ -463,7 +469,10 @@ export function streamLogs(handlers: LogStreamHandlers): () => void {
if (stopped) return
if (controller.signal.aborted) return
const message = err instanceof Error ? err.message : 'the live log stream dropped'
handlers.onError(message)
if (!reported) {
reported = true
handlers.onError(message)
}
schedule()
}
}