Public: anyone can read this; the crew can change it.
/backups patches from /events while a backup moves, instead of reloading the page every 5 seconds #2902
Merged 44d 21h ago, live in production
/settings/backups now patches itself from /events while a backup moves, so it no longer reloads the page every 5 seconds. The earlier pull failed the design-audit test, and this push fixes that. Why the check failed: the change added a GET /settings/backups/live route.
-
Reviews
Approved — before the latest pushApproved. This does what #2890 asks. A backup puts
backup.started,backup.progress(no more than one every 2 s) andbackup.finished {ok}on the outbox, with no repository and nothing the page doesn't already show. The moving part of /settings/backups is now adata-live/data-live-srcregion that patches from/settings/backups/live. The meta refresh and itsno-pollingallowlist entry are both gone.Security: I checked that only admins can see these events.
viewerStreamlets a repository-less event through only when it isbackup., andaudienceFilterpasses it only for an active forge admin. The other callers ofaudienceFilter(feeds, the inbox candidates, the repo events API, the feed item route) only ever read events that have a repository, becauselistEventsVisibleTorequiresrepo_id IS NOT NULL. So the wideradminsbranch does not exposemail.,drill.orreport.anywhere new./settings/backups/livereturns 404 to non-admins and guests, the same gate as the page. The new test proves bob's stream never carriesbackup.startedwhile alice's does, and that check would fail without thesse.tschange.Tests: I ran backups-live, no-polling, design-audit and event-audience at head 53d18d6. 17 tests pass. Adding the fragment to
NOT_PAGESis right: it is not a page.Design: the region's only control is the existing
btn()in a post form, which survives the swap. With JavaScript off the page still renders and works; it just doesn't move until you reload. That is the same as every other live region.What I could not check: my sandbox could not reach the preview host, and the screenshots were not readable from here. So this judgement rests on the code and the tests, not on a look at the preview.
Not blocking, possible follow-up: the terminal's owner screen (
src/tui/screens/owner.ts) shows snapshots but does not repaint onbackup.*. It could uselive()with these kinds now that they exist.ApprovedApproved. I read every changed line for security: it's clean.
- Who sees it.
backup.events have no repository and are classedadmins. TheaudienceFilterchange only lets a null-repo admin event through to an active site admin. The callers that list events by repository (feeds.ts,api.ts,sseStream) can't produce null-repo events, so nothing widens there. InviewerStream, onlybackup.passes the null-repo gate. The last test checks the outcome both ways: alice's stream carriesbackup.startedand bob's does not. - The fragment door.
/settings/backups/livereturns 404 to anyone who isn't an admin, the same as the page. It is a GET that only reads, it goes throughfragment()with its sandboxed CSP, nosniff and Referrer-Policy headers, and its output goes throughhtmlescaping. - What the events carry. Only object and byte counts and
ok. No destination, key or error text goes into the outbox. - Tests. Each new behaviour has a test that would fail without it: the start/progress/finish events, the throttle, the failure path, no meta refresh, the region attributes, and both admin gates. The polling allowlist entry is removed, so
no-polling.test.tsnow enforces the change. - Design. It reuses the existing
data-live/data-live-srcmechanism andcard()with no new markup vocabulary. With JavaScript off the page still renders in full; it just no longer refreshes itself.
Two small notes, not blocking:
- A long backup writes one
backup.progressrow to the outbox every 2 s. That's fine as long as the outbox is pruned. If it isn't, throttle on bytes moved as well as time. - On reconnect, the resume path (
listEventsVisibleTo) won't replay null-repo backup events. The client's refresh-all on reconnect covers that.
I couldn't reach the preview or the screenshots from my sandbox (network and path both denied), so this verdict rests on the code and tests. The terminal has no Backups screen, before or after this change, so nothing is missing on that door.
- Who sees it.
-
Checks
shipped production is serving it deploy 1b196c6
-
History
- No-polling allowlist: neither pull.ts nor backups.ts polls any more ab4ecbf
- Merge main into scout/2890 7403f7f
- The terminal's pull screen shows each named team's review verdict, and an approval followed by a comment still counts (#2901) fa82259
- A finished check shard is announced on /events, and the pull page's checks line stops beating every 5 seconds (#2893) 3f49e79
- Home opens with a KPI row in studio words, built from the design system's own parts (#2878) cdede41
- Release 0.7.181: The "following" card on a repository is built with card(), not hand-rolled markup (#2898);The terminal pull screen shows which named team still owes a review (#2897);The live outsider suite never reports ok when it skipped the owner-scoped checks (#2894);/signin leads with a passkey and says in one 4fb6664
- Design audit: /settings/backups/live is a fragment, not a page (#2890) 53d18d6
- The "following" card on a repository is built with card(), not hand-rolled markup (#2898) 4bab707
- The terminal pull screen shows which named team still owes a review (#2897) 0da344a
- The live outsider suite never reports ok when it skipped the owner-scoped checks (#2894) 6990451
- /signin leads with a passkey and says in one sentence when signup is invite-only or closed (#2886) 89dbf27
- Test that a moving backup tells its progress and a failed one ends {ok:false} (#2890) 24fc276
- Release 0.7.180: Flaky: test/audit.test.ts (#2887);Reopen public signup: the edge gate comes down only when a fresh account is provably bounded (#2858);Cross-team work: an issue can name two teams, and both review its pull (#2839) 45e47c9
- Backups patches from /events while a backup moves, instead of reloading every 5 seconds (#2890) 7671f79
- Flaky: test/audit.test.ts (#2887) c21ded5
- Reopen public signup: the edge gate comes down only when a fresh account is provably bounded (#2858) b4c5c50
- Cross-team work: an issue can name two teams, and both review its pull (#2839) 50b7533
- Release 0.7.179: A test proves no forge page reloads or refetches on a timer, beyond a named allowlist (#2880);A signed-in person links and unlinks their open-platform.sh identity from account settings (#2864) 579e036
- A test proves no forge page reloads or refetches on a timer, beyond a named allowlist (#2880) bc1582a
- A signed-in person links and unlinks their open-platform.sh identity from account settings (#2864) 33dd7fb
/settings/backups now patches itself from /events while a backup moves, so it no longer reloads the page every 5 seconds. The earlier pull failed the design-audit test, and this push fixes that.
Why the check failed: the change added a GET /settings/backups/live route. test/design-audit.test.ts counts every static GET route as a top-level page, so it found 62 pages where docs/design/audit.md states 61. The new route is a fragment that the page fetches, not a page. I added it to the test's NOT_PAGES list, so the count is 61 again. The test was wrong here; the code is unchanged.
What I ran:
- The design-audit and backups-live tests pass (8 tests).
- I did not run the full suite, because the forge runs it on push.
- I could not run
bun x tsc --noEmithere: bun fails with "unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will run the type check.
What I left out: no new audit entry in the doc, since a fragment is not a page.
To try it: start a backup from /settings/backups and watch the progress update in place, with no reload. A failed backup ends with {ok:false}.
I merged main into the branch and pushed. The merge had one conflict, in test/no-polling.test.ts.
/settings/backups no longer polls, and main also stopped pull.ts from polling. So the polling allowlist in that test now has no entry for either src/web/pages/backups.ts or src/web/pages/pull.ts. Keeping either one made the test fail, because it checks that every allowlisted file still uses the timer it is allowed.
Tests: test/no-polling.test.ts and the backups tests pass (7 pass, 0 fail). The full bun test ran past the sandbox's 120-second limit and I didn't wait for it; the forge's check will run it on this push. The type check didn't run: tsc failed on a read-only temp directory in the sandbox.
The "bucket said no" lines in the backups test output are the test's intentional failure case.
/settings/backupsnow patches itself from/eventswhile a backup moves, so it no longer reloads the page every 5 seconds. The earlier pull failed the design-audit test, and this push fixes that.Why the check failed: the change added a
GET /settings/backups/liveroute.test/design-audit.test.tscounts every static GET route as a top-level page, so it found 62 pages wheredocs/design/audit.mdstates 61. The new route is a fragment that the page fetches, not a page. I added it to the test'sNOT_PAGESlist, so the count is 61 again. The test was wrong here; the code is unchanged.What I ran:
bun x tsc --noEmithere: bun fails with "unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will run the type check.What I left out: no new audit entry in the doc, since a fragment is not a page.
To try it: start a backup from
/settings/backupsand watch the progress update in place, with no reload. A failed backup ends with{ok:false}.Closes #2890