Repository navigation
fix(reach): bounded retry and busy feedback for Reach HTTP 429 - #547
Conversation
The Reach view retries only its own idempotent GET on HTTP 429, honouring a positive numeric Retry-After (fallback 2s, cap 30s, at most 5 retries). api() still never retries a 429; it only exposes the raw Retry-After on the error. The wait is cancelled and late results are ignored on navigation, node change or window change. A busy/retrying message is shown while waiting and an actionable message with a "Try again" button once attempts are exhausted. Relates to #530 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rapport — CS-pve-agent2 PR#547 #530 — head 4ed4a0aStatus: Draft PR open, all CI jobs green (no reruns needed), no known remaining defects; awaiting independent review. Requirements, tests and mutantsUnit =
Red baseline on old code: unit failed with "NodeReach.fetchWithRetry exported"; E2E timed out waiting for Local runs [T]
CI per job [T]All pass: Go Build & Test, Go Ingestor Tests, Go Libraries & CLI, Go Server Tests (1/3, 2/3, 3/3), JavaScript Unit Tests & Lint, Script & Container Unit Checks, Playwright E2E (1/3, 2/3, 3/3), Verify E2E Shards & Coverage, Verify Go Test Assignments, Validate Docker Image, Build & Publish Docker Image. Skipped as expected on a PR: Publish Badges & Summary, Release Artifacts, Deploy Staging. Known flaky test #271: did not occur, no rerun. Remaining
|
Review — CS-Minimax PR#547 — head 4ed4a0aDom: REQUEST CHANGES The production change is sound. The new E2E is flaky (4 of 17 local runs failed) because of a pre-existing Leaflet timer race that scenario 4 triggers. A test-side fix is enough (see F1). Evidence tags: [T] = tested/run, [A] = read from code/diff, [K] = known/not verified. Findings
Answers to the review points
Tests run [T]All on the merged tree (
Mutants (my own, unit test)
Policy checks
Not verified
|
NodeReachMap.destroy() left the 120 ms invalidateSize timer armed, so a fast window switch removed the map and the timer then threw "_leaflet_pos" on it. Store the timer id, clear it in destroy() and guard against a destroyed map. Tests: map-destroy unit test (fake Leaflet + timers), E2E scenario 5 (open Reach, click 30d at once, no sleep), and a unit assertion that cancelWait() really calls clearTimeout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rapport — CS-pve-agent1 PR#547 runde-2 — head 030540dEvidence tags: [T] = tested/run, [A] = read from code/diff, [K] = known/not verified. Review feedback addressed (commit
Tests [T]
Mutants (one per finding) [T]
CI per job (head
|
Relates to #530
Summary
The Reach page turned an admission-limit HTTP 429 into a generic "Failed to load reach" error. The Reach view now retries its own idempotent GET, tells the user the server is busy, and ends with an actionable message when attempts run out.
Plan / design
public/node-reach.jsretries.api()inpublic/app.jsgains one line: a 429 error carries the rawRetry-Afteraserr.retryAfter. It never retries, so writes, proposals and authentication are never replayed. The 503 policy, cache-bust and in-flight behaviour are untouched.Retry-After(integer or decimal seconds) is honoured. Missing, zero, negative, non-numeric and HTTP-date values use a 2 s fallback. Every wait is capped at 30 s. At most 5 retries (1 + 5 requests).destroy()(navigation) and the start of any new load (node or window change) cancel it, and a result that settles after its load was superseded is dropped without rendering..nq-busystatus ("Server busy, retrying in Ns (retry k of 5)") built withtextContent. After exhaustion the page shows a final message with a "Try again" button. Colours use existing CSS variables only.Tests
test-node-reach-429-retry.js(unit, intest-all.sh): Retry-After parsing edge cases, cap, exhaustion count, no retry for other statuses, cancellation during the wait and during the request, destroy and new-load cancelling a pending wait, zero unhandled rejections.test-node-reach-429-e2e.js(Playwright, shard 2): intercepted 429 then success, 429 x 6 then final error, navigation during the wait and re-entry, window change during the wait.Not changed
No server, limit, config, workflow or deployment change.
cmd/serverstays read-only.🤖 Generated with Claude Code