Skip to content

fix(test): take next 16.4.6 by fixing the hydration race it exposed - #1111

Merged
athvin merged 2 commits into
mainfrom
fix/next-webkit-range
Nov 17, 2026
Merged

athvin merged 2 commits into
mainfrom
fix/next-webkit-range

Conversation

@athvin

@athvin athvin commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #1105

next 16.4.6 was held back by #1104 because carrying it failed
playwright functional tier on webkit. The cause was a racing test, not a
Next regression
, so the bump lands here with the race fixed.

What was actually wrong

#flow-volume is a controlled input — interactive-story.tsx holds
volumePosition in useState(DEFAULT_VOLUME_POSITION). A fill() that lands
before hydration sets the DOM value, and React then mounts, re-renders from its
own default, and silently reverts it. That is why the failure read
value="9.95037190209989" / "100,000 records per run": not arithmetic, not a
flake — the default.

The volume test was the only test in this file that interacted immediately
after goto()
. Every other one clicks something and asserts a state change
first, which incidentally proves hydration. So it had always been racing and
simply won on timing; 16.4.6 shifted hydration late enough to lose
consistently under load.

Gated on "Inspect a record", which is disabled={!ready} where ready is
set in story-flow's mount effect — a pure hydration signal. Deliberately not
data-still, which also depends on reduced motion and would make the gate
inert in the reduced-motion case.

How it was reproduced, which took three attempts

This is the part worth keeping, because two plausible loops prove nothing here:

attempt result
local make frontend (macOS) 684/684 passed — macOS webkit passes what Linux webkit fails
the spec alone in the pinned Linux image 1 passed — isolation hides it
the shard in the pinned image, --shard=1/2 --workers=2 1 failed, 95 passed ← reproduces

So both the OS and the shard parallelism are part of the repro. The harness
copies the project into mcr.microsoft.com/playwright:v1.63.0-jammy and runs
CI's exact args, the same approach scripts/frontend-dev/update-baselines.sh
takes for visual baselines.

After the fix, same command, same image, same next 16.4.6:

96 passed (1.9m)

pnpm run check also passes locally: lint, prettier, tsc, all four BFF gates,
922 unit tests.

A product observation, deliberately not acted on

The underlying behaviour is real and not test-only: a visitor who grabs that
slider during hydration has their input reverted. It is inherent to a
controlled input plus SSR, it is bounded by hydration time on a static
marketing page, and chasing it means changing the control to be
uncontrolled-until-hydrated — a real change to hand-rolled marketing code with
its own risk. Noted rather than smuggled into a dependency bump.

Post-merge ledger

Closed by: agent · session f14bf995-5565-41eb-9658-d3746dc3188e on Mac · 2026-11-17T07:45:00Z

  • main is green with this change on it — merge SHA
    c06b516fd3b9bf86835331bf4b42ba5726b6af3c. On that SHA: rust,
    frontend, infra, devcontainer and images all completed/success.
  • images built — the c06b516f run built er-web and skipped
    er-api, correct for a frontend/ change.
  • deploy converged — run 44032634367, DEPLOY_SHA read from inside
    the run is c06b516fd3b9bf86835331bf4b42ba5726b6af3c. The run list
    labelled it with the later main SHA 9f905b1f, so the label alone would
    have attributed this deploy to the wrong change. Proved by process-emitted
    lines: deployment "web-api-blue" successfully rolled out,
    er-api-preview /readyz -> 200, er-web-preview /api/healthz -> 200,
    ALB reports 2 expected pod targets healthy,
    public readiness stayed healthy for three minutes,
    traffic is verified on blue; old targets drained, retired green.
  • the push-only surface — deploy green (above); kind green (dispatch
    44025072671, ALL PHASES PASS). drift is red, knowingly and for a
    reason that is not this change
    : feat(obs): assert the alarm path terminates at a confirmed subscriber #1110 added an alert path job that
    correctly reports the unconfirmed SNS subscription (The er-alerts SNS email subscription has never been confirmed — 19 armed alarms reach nobody #1107). All four
    Terraform drift legs are green.
  • the board card — next 16.4.6 breaks a controlled range input on webkit; held at 16.4.5 #1105 reached CLOSED through GitHub's closing
    reference.
  • follow-ups — n/a — nothing is owed from this change. The bump landed
    in full rather than being held back, which was the point.
  • what was learned is written down — memory
    next-1646-webkit-range-input rewritten: the cause was a hydration race
    in the test, not a Next regression, and the reproduction needs both
    Linux webkit and the shard parallelism.

Specific to this change

  • all four playwright shards ran and passed on CI, webkit included —
    verified per job rather than from the rollup: playwright e2e (webkit 1/2), (webkit 2/2), (chromium 1/2), (chromium 2/2) all
    success, plus the playwright functional tier rollup. A rollup that
    reports success with skipped shards would have proved nothing, and this
    pull request's whole claim is about a shard-only failure.
  • no Dependabot ignore entry was added — next is now at 16.4.6 with no
    ignore: block anywhere in .github/dependabot.yml, so future releases
    keep being offered. Holding it back was explicitly rejected as the
    resolution.

The volume test was the only one in this file that interacted immediately
after goto(). #flow-volume is React-owned (interactive-story.tsx holds
volumePosition in useState), so a fill() landing before hydration sets the DOM
value and is then silently reverted when React mounts and re-renders from
DEFAULT_VOLUME_POSITION — the input reads back 9.95037190209989 and the
assertion sees "100,000 records per run".

So it was always racing, and won on timing until next 16.4.6 shifted hydration
later. Every other test in the file clicks something and asserts a state change
first, which incidentally proves hydration; this one did not.

Gated on "Inspect a record", which is disabled={!ready} where ready is set in
story-flow's mount effect — a pure hydration signal. Deliberately not
data-still, which also depends on reduced motion.

Reproduced and verified in the pinned Linux image, since macOS webkit passes
what Linux webkit fails and the spec passes when run ALONE even there — the
shard parallelism is part of the repro:

  before  --project=mobile-safari --shard=1/2 --workers=2  ->  1 failed, 95 passed
  after   same                                             ->  96 passed
Held back by #1104 because the bump failed playwright on webkit. The cause was
a racing test rather than a Next regression, so the bump lands with its two
version-locked companions.

Closes #1105
@athvin
athvin merged commit c06b516 into main Nov 17, 2026
40 checks passed
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.

next 16.4.6 breaks a controlled range input on webkit; held at 16.4.5

2 participants