fix(dashboard): name the proxy's real load status for a refused tail

The proxy caps rate and concurrent tails with 429, so the retry
reasoning and its test now say so. Leaving Follow also remounts the
log list, so the history it falls back to opens at the newest line
even when the reader had scrolled up while following.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
This commit is contained in:
ZverGuy committed 2026-11-04 05:53:23 +07:00
1 parent 1b4ce7433e
commit ebdd74ce4e
3 files changed
+4 -3

No files matched your search

@@ -129,7 +129,7 @@ export function LogsView({ scope }: { scope: ObservabilityScope }) {
</p>
)}
{error ? <ProxyNotice what="Logs" error={error} /> : null}
{!follow && history.isLoading ? <Spinner /> : <LogLines entries={entries} />}
{!follow && history.isLoading ? <Spinner /> : <LogLines key={followRun ?? "history"} entries={entries} />}
</div>
)
}
@@ -68,7 +68,7 @@ describe("useLogTail", () => {
})
it("retries a tail refused for load instead of stopping", async () => {
const { wrapper } = setup(new Response("too many concurrent requests", { status: 422 }), ndjson(line(T1, "a")))
const { wrapper } = setup(new Response("too many concurrent requests", { status: 429 }), ndjson(line(T1, "a")))
const { result } = renderHook(() => useLogTail("/root/", "*", 1, { retryDelayMs: 1 }), { wrapper })
@@ -14,7 +14,8 @@ interface TailSnapshot {
const FLUSH_MS = 100
const MAX_RETRY_MS = 30_000
// A 422 or 429 on tail is load (rate or concurrent-tail caps), which backoff outlasts.
// Load refusals retry: the proxy caps rate and concurrent tails with 429 (422 in
// its first builds), and a reconnect can race the previous tail's freed slot.
const FATAL: ReadonlySet<string> = new Set(["bad-request", "unauthorized", "forbidden", "not-available"])
const sleep = (ms: number, signal: AbortSignal) =>