Vantiboo1ean (Discord, ~750k requests): on Usage > Requests each filter,
model pick or refresh sent another read of the page and of the heatmap.
The page dropped the answers it no longer wanted, but the requests kept
running. A browser opens about 6 connections to one host, so the newest
read queued behind them and the page spun on, and every press added
another read.
Now loadLedger and loadLedHeat go through ledRead:
- A read with a different query aborts the one before it
(AbortController; api() takes a signal).
- A read of the same query (the refresh button, the timer) joins the one
already on its way instead of sending a second.
- An aborted read returns quietly and is never shown as an error.
The server side (the reads themselves taking seconds) is the commit
before this one.
Tests:
- usage-ledger-abort.test.cjs (new) runs in Chromium and WebKit at 1180
and 560 px with every answer held. It types three narrowings and checks
that the page and heatmap reads for the first two are cancelled and the
wanted one is not. It checks that Refresh pressed during that read sends
no second read, that the newest answer is drawn, that "abort" is never
shown, and that a later refresh reads afresh. Against the old assets
(MAGPIE_ASSETS) it fails: the stale reads are left running.
- usage-ledger-chart.test.cjs accepts that its held first read is now
cancelled by the second click.
- No new strings.
Run: the Usage GUI suite (32 files: usage-*, ledger-*, request-archive*,
panel-usage, routing-upstream, web-page …):
- WebKit: 150/150.
- Chromium: 149/150. The one failure is panel-usage "chromium zh" (the
tray panel shows 4 tabs, where the test expects 3). It fails the same
way, run alone, on the base 8d95ebc8 and on origin/main 0a11b183. These
assets don't touch the panel; it is reported to be fixed on its own.