Commit Graph
11 Commits
Author SHA1 Message Date
affaan-m 621abca350 fix(control-pane): bound snapshot loads and automatic polling
Preserve ordered manual/query recovery while giving snapshot headers and bodies one ten-second deadline. Keep action mutation behavior unchanged.

Source-PR: https://github.com/affaan-m/ECC/pull/3235
Source-Parent: aff9c64560
Review-Manifest-SHA256: 59efa4136448129df673d047e633e88351c98cc1fcdc812f475575bc6f6ce201
2026-09-28 02:47:12 -04:00
affaan-m aff9c64560 fix(control-pane): preserve snapshot integrity during failed refreshes 2026-09-27 21:03:37 -04:00
L4XB 217f303713 fix(control-pane): fail a load whose snapshot cannot be shown, and run the shown query
render() ran after load()'s ordered failure path and after shownLoad
had moved on. A snapshot the board could not show (a session whose
detectedHarnesses is stored as an object) threw past the ordering, and
an older valid snapshot could no longer take the board. render() now
runs inside that path, and shownLoad moves only once it returns.

Run posted state.query, the query typed last. When an older load
succeeds after a newer one failed, the board shows the older query's
results and recall command while Run acted on the newer query. Each
load now keeps its query, render() records it for the board, and Run
posts that.

The test harness assigns new arrays instead of pushing onto
page.pending, and records requests the same way.
2026-09-25 06:45:11 +02:00
L4XB a82d587e3f fix(control-pane): order data and outcomes of every load separately
Two cases the finished-load rule got wrong. When the first snapshot was
still loading and a live refresh failed, the first snapshot arrived
late and was dropped, leaving the pane empty. And manual loads, the
Refresh button and a query, reported their failures outside the
ordering, so a late manual failure could cover newer data and an older
success could clear a newer manual failure.

The board now shows the newest data any load brought, and the error
box the outcome of the newest load that has finished. load() reports
its own fetch failures, as a live-refresh failure when the interval
started it and as a plain error otherwise, so every load is ordered the
same way. Data that arrives after a newer failure still shows, and the
failure stays, dated by that data.
2026-09-25 04:59:07 +02:00
L4XB 36460824ee test(control-pane): pin that a late response keeps its hands off newer data
Two held refreshes complete in reverse order with different data. The
older response arrives last and must not replace what the newer one
put on the board. It did before the previous commit.
2026-09-25 03:13:18 +02:00
L4XB 928a295247 fix(control-pane): let the newest finished load decide the board
A newer refresh that failed was shown, and then an older one that
succeeded cleared the message, so the board looked live although no
load that started after the failed one had succeeded.

The board now follows the newest load that has finished, with its data
or with its failure. A load that finishes after a newer one leaves the
board alone: its data is not rendered and its failure is not reported.
This also keeps a late response from replacing newer data.
2026-09-25 03:12:40 +02:00
L4XB 029f850bd0 test(control-pane): pin which load decides a failed refresh
With three refreshes in flight, the second succeeds and the first
fails while the third still runs. The board shows data from a load that
started after the failed one, so the failure stays off it. Comparing
against every load started so far would report it.
2026-09-25 02:56:33 +02:00
L4XB 96516aa247 test(control-pane): give the page a fixed clock
The refresh-failure test looked for the current Gregorian year in a time
the page formats with toLocaleString. A locale with another calendar
shows another year: under th_TH the page prints 2569 and the test
failed. The page now runs on a fixed instant, and the test compares
against toLocaleString of that instant.
2026-09-25 02:55:35 +02:00
L4XB 9848380309 fix(control-pane): judge a failed refresh by the loads that started after it
A failed refresh was dropped whenever any load finished while it ran.
When two interval refreshes overlapped and the older one succeeded, the
newer one's failure was dropped too, so the board looked live although
its latest refresh had failed.

Loads are now numbered as they start. A failure is dropped only when
the board shows data from a load that started after it.
2026-09-25 02:55:35 +02:00
L4XB 10969f587b fix(control-pane): keep a superseded refresh failure off the board
A live refresh that fails after a newer load has already replaced the
board no longer describes what is shown, so it is only reported while
the data it was meant to replace is still on screen. The time of that
data now includes its date, for a pane left open overnight, and it is
kept in its own binding instead of on the shared state object.
2026-09-25 00:07:08 +02:00
L4XB 0ae2fa06a4 fix(control-pane): report a failed live refresh instead of discarding it
The 15-second refresh caught every error with `load().catch(() => {})`,
so a control pane that had lost its server kept showing the last
snapshot as if it were current. A failed refresh now shows the error box
with "Live refresh failed. The data below is from <time>." and the
error, and the next successful refresh clears it, as load() already
clears the box.

The new test runs the served page script in a vm with a stand-in for the
browser APIs it uses, fails a refresh, and checks both transitions.

Fixes #3176
2026-09-24 23:25:13 +02:00