Skip to content

fix(ui): stop a burst of control API requests on every live refresh - #1367

Closed
kvlonge wants to merge 4 commits into
mainfrom
fix/ui-refresh-burst
Closed

kvlonge wants to merge 4 commits into
mainfrom
fix/ui-refresh-burst

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Why

The live pages reload on every change notice, and a running job sends many. On the jobs page, each reload also read one tick list per trigger and fetched the 1,000-run listing more than once. On a small synthetic DuckDB location, one four-node job run (plus the run its sensor started) made the open Jobs page send 227 API requests, each its own authorized store transaction.

Changes

  • The person trigger listing returns each trigger's newest tick (latest_tick), read through the trigger-time index in the listing's transaction, so a list needs no read per trigger. Authorization is unchanged: view on every current node of the target, as for the listing itself.
  • Pages coalesce change notices: one reload starts 300 ms after a burst, and notices during a reload queue at most one more.
  • The HTTP client shares an in-flight jobs, triggers or runs listing between pages that refresh together; a write clears it, so reads after a write fetch again.

Verification

  • Same scenario, requests per page before → after: Jobs 227 → 26, Triggers 155 → 16, Runs 30 → 12, with lists unchanged (screenshots in the delivery thread).
  • cargo test for the HTTP reads test on SQLite and PostgreSQL: the listing carries the newest of two ticks, and a target without ticks lists null.
  • npm run check, npm test (new client tests: one request for triggers with ticks; shared listings and a fresh read after a write), regenerated control client, make check-ci.
  • DuckShop: no edge case applies; this changes UI request behaviour and a listing field, not a project shape, data value or lifecycle sequence.

The person trigger listing now carries each trigger's newest tick, so the
jobs and triggers pages no longer read ticks once per trigger. Pages
coalesce change notices into one reload, and the HTTP client shares an
in-flight listing between pages that refresh together.
@kvlonge
kvlonge enabled auto-merge (squash) November 8, 2026 08:13

kvlonge commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Folded into the single combined sqlbuild PR (D625/D626), which the SQLBuild lane is assembling now and opens once #1377 lands. Branch kept.

@kvlonge kvlonge closed this Nov 8, 2026
auto-merge was automatically disabled November 8, 2026 21:16

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant