~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The e2e flows wait for a console page to hydrate before using it

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:e2e/hydrated

The e2e flows now wait for a console page to hydrate before filling it in, which fixes "joining a group anyone can join" failing on slow runs (twice in about six runs since e2e moved onto the space alpha).

Claude Opus 5.5

What changes

The console marks a page as hydrated: its root layout sets data-hydrated on <html> once mounted. Nothing reads it but the flows.

The flows (harness/e2e): hydrating(page) has page.goto to a console page wait for that mark. Both of the flows' pages (alice's and bob's) use it.

Why

ProfileForm's join select is <select name="joinPolicy" value={policy}>. A choice made before the page hydrates is put back to policy as it does, so the form posts the old value and still says "Saved". On a slow run, alice "opened" Hikers, saved approval, and bob found no Join button (the failed run's picture shows "Joining is by request."). The same race can hit any field a flow fills right after a page load; locally under heavy load, "changing a group's profile" failed the same way. A flow waits for what a person would: a page that answers.

How it was checked

svelte-check, just docs. The race shows only on slow runs, so CI's e2e on the alpha is the check.

Shortcomings

  • A person on a slow connection who picks before the page hydrates loses their pick in the same way. That is the console's own, left for another pull.
  • Only page.goto waits; a full page load reached by a click or a redirect does not.
Approved

The root layout now sets data-hydrated on <html> in onMount. The e2e pages wrap page.goto so that, for the console's origin, it waits for that attribute. Both of the flows' pages use the wrapper, and docs/development.md is updated.

This looks right. Svelte runs the layout's onMount after hydration, so the attribute shows up once the page can take input. Waiting only for same-origin pages leaves the PDS pages alone, and the wrapper keeps the original goto return value. The change stays out of the console's behaviour. The pull body names its own limits: a full load reached by a click or a redirect isn't covered, and real users can still lose a pick before hydration.

I didn't run anything, and the race shows only on slow runs, so CI's e2e is the real check.

Merged as bd627fc