Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit c68f1fe33d2a24ef909e4bb99b7fbf8353aad486
parent 1cbc1ee9fc3cddcc29d4f07d15b61dd11844384b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sat, 10 Oct 2026 17:24:56 -0400

plans: release 24 H5 — the /sites saves' stall, as shipped

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mplans/release-24.md | 50+++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/plans/release-24.md b/plans/release-24.md @@ -111,6 +111,48 @@ was forced with an untracked copy of `mix.spec.ts` that sorts first (`a-mix-firs After the first run `testchan/vid1/clips/0.00-14.00.mp4`, clip-bench's editor-stub window, was back on disk: mix had set it aside and restored it. +### H5, as shipped — `sites-crud.spec.ts:491`, the hub form's "Saved." (added by the orchestrator) + +**The race.** In the production build, a server action that calls `revalidatePath` makes the router refresh the page +as the action lands. React commits the action's `useActionState` state together with that refresh. Now and then the +refresh did not settle until the next router update, which is AutoRefresh's tick about 5 s after the page loaded, so +"Saved." (and the button's "Saving…") waited with it. + +Measured with an untracked diagnostic spec. Across about 140 hub saves (start mode), the click was always hydrated +(not a pre-hydration native POST), the action's POST answered in about 15 ms with its body complete, and "Saved." took +about 110 ms. Five saves took 4.9–5.9 s, each ending just after a lone `/sites` RSC refresh. Without `revalidatePath`: +0 slow in 18. With it, the control run had 1 slow in 18. The status of the previous save was not the cause: each save +in the spec follows a fresh `goto`. + +A first suspicion was wrong: the sidebar prefetching `/sites` while on `/sites`. With that prefetch switched off, the +stall still happened. The same stall hit SiteForm's saves (`:53` and `:588`) and the delete button (`:126`) in this +file's own gate runs. + +**The fix** applies to the four `/sites` writers this spec drives. Each one saves without revalidating and refreshes +the page itself once its result has landed, so the confirmation never waits on a page render: + +- **The hub form** (`saveHomepageConfigAction`). +- **The site form** (`saveSiteAction`). +- **Delete and migrate** (`deleteSiteAction`, `migrateToSitesAction`). +- **What the forms do:** + - A success hands back what was submitted (`values`), and the form seeds from it (`seedAfterSave`, + `lib/formState.ts`). React's form reset after the action therefore shows what was saved. + - `useRefreshAfterSave` (`lib/useRefreshAfterSave.ts`) calls `router.refresh()` once the state is in, so the h1 + above a site's tabs, the `/sites` list and the Publish rows follow. +- **What delete and migrate do:** they call `router.refresh()` after their result. +- **New test:** sites-crud holds every non-prefetch `/sites` RSC read for 6 s. It still expects "Saved." within the + default 5 s, and the fields to show what was saved. `formState.test.ts` +1 covers `seedAfterSave`. + +**Found and left.** +- Every other editor action that calls `revalidatePath` keeps the same exposure: the publish actions, the reports + actions, release cuts, settings, and the channel and job actions. This release changes only the four writers above. +- AutoRefresh refreshes every page about 5 s after it loads. The pulse's first poll counts as a change (`revCounter` + 0 → 1). It is what ended each stall above, and it is a full server render per page load that its own comment says + should not happen. +- The underlying Next.js behaviour (16.2.3: the post-action navigation not settling) was not traced further than the + reducer: `server-action-reducer.js` resolves the action early, and React holds the state for the entangled + navigation. + ### Commits | Commit | What | @@ -119,7 +161,9 @@ set it aside and restored it. | `60cea572` | `common, umtool:` H2 — `deps.freeBytes` in attachMedia/preparePlayable and their tests; `sources.test.mjs` through `tildify` | | `198d4a8f` | `common:` H3 — `keepProvenanceFields` / `keepProvenanceInFile` in the history wrap | | — | H4: no commit (release 19 B5 `10042c2d` fixed it; verified above) | -| this commit | `plans:` this record; `editor/CHANGELOG.md` (two bullets at the start of `[Unreleased]`) | +| `c2840cf1` | `plans:` this record; `editor/CHANGELOG.md` (two bullets at the start of `[Unreleased]`) | +| `0e887173` | `editor:` H5 — the four `/sites` writers save without revalidating (`seedAfterSave`, `useRefreshAfterSave`); the sites-crud test; a changelog bullet | +| this commit | `plans:` the H5 record | ### Gates @@ -134,4 +178,8 @@ set it aside and restored it. | export unit | 118/118 | | umtool e2e `clip-bench.spec.ts mix.spec.ts` (`E2E_MODE=dev`) | 62 passed, 2.7 min (clip-bench first) | | umtool e2e, mix first (`a-mix-first.spec.ts` + `clip-bench.spec.ts`) | 62 passed, 2.4 min | +| H5: tsc; editor unit | clean; 247/247 (+1) | +| H5: `pnpm e2e sites-crud.spec.ts --repeat-each=3` (start mode) before the fix | 53 passed, 4 failed (a first, wrong fix); then 56 + 1 failed (`:588`); then 56 + 1 failed (`:126`): the same stall each time | +| H5: the same, after `0e887173` | 57/57 (58.6 s), and again 57/57 (55.3 s) | +| H5: the untracked diagnostic spec, 30 hub saves on the fixed build | 30 under 400 ms (before: 1 in 18 at ~5.9 s) | | counts-only privacy greps over `72c44159..` (home paths, the operator's names and email, session links and trailers) | 0 each |