Repository navigation
docs: spec and plan for the upstream Next abort-fix validation - #402
Merged
Merged
Conversation
Rather than patch Next locally to quiet pretable #377, help the upstream fix land: two community PRs sit unreviewed with no maintainer comment, and both rest on one synthetic test. The design's load-bearing part is the check the error count cannot provide. A fix that correctly classifies the abort and a fix that stopped cancelling renders BOTH show zero errors — the second silently burns server time finishing responses nobody reads. So each arm runs a cancellation twin that fails loudly in that case, and the twin is itself proven capable of firing first. Nothing is posted upstream without explicit approval of the drafted text. Co-Authored-By: Claude Opus 5 <[email protected]>
Three arms, each verified green before its numbers count, plus a cancellation twin that fails loudly if a fix wins by no longer cancelling renders rather than by classifying the abort correctly. Task 1 exists to establish the twin's discriminating power BEFORE any PR is measured: it proves the marker can fire at all, then proves it stays absent on an aborted baseline render. Whether React declines to render a component after an abort is left as a tested gate with a documented alternative, not an assumption — a wrong guess is caught in the first task instead of silently invalidating every later number. Co-Authored-By: Claude Opus 5 <[email protected]>
…fects The twin aborted a plain HTML document load. On unmodified 16.3.0 that gave closed-early 0 and RENDER-COMPLETED 1 — it neither cancelled the render nor reproduced the phenomenon at all, so it had no discriminating power to lend the PR arms. They would have scored identically whether or not the PRs worked. That matches both the source analysis (the RSC path pipes into a PassThrough with a direct res.close -> pt.destroy() link; the document path goes through a pipe chain where destroy does not propagate upstream) and the proxy data from the original investigation, where the aborting requests were ?_rsc= router fetches. Task 1 now drives a real client-router navigation with Playwright rather than forging RSC headers, which 307 without the router state tree. The gate the plan was missing: a positive control on the ERROR, not just on the marker. A baseline that cannot produce the error makes every later zero meaningless. That is now Gate B, and it is what would have caught this before three arms of numbers. Two defects of mine, both found by review rather than by running: - RESULTS resolved to /Users/blove/repos/pretable/next-abort-results — inside the repo the plan forbids writing to. Off by one in the ../ count. - The four files as written do not build; Next's generated /_global-error needs a root route. And one found while rewriting: the driver took an id but the link hardcoded ?id=nav, so every per-run grep would have matched nothing — and an absent marker is exactly what this twin reads as 'render cancelled'. A false pass. Co-Authored-By: Claude Opus 5 <[email protected]>
`pnpm --filter next build` does not build workspace dependencies and fails in ~3s on a missing polyfill-module. Turbo's build task has dependsOn ^build and does. Both Task 3 and Task 5 carried the broken command. The spec's named risk did not materialise: Next's postinstall downloads a prebuilt @next/swc-darwin-arm64, so no Rust compiles. Install 56s, build 63s. The gate stays for later arms, but is no longer the thing to plan around. Recorded what arm B actually is, since '7 files changed' oversells it: one source file at +12 lines, six new e2e fixtures. The change registers a close listener on the PassThrough BEFORE pipeable.pipe(pt), so Node runs it ahead of React's own handler and aborts with a reason isAbortError recognises. Also recorded two source facts that make the fix load-bearing rather than redundant, both of which belong in the upstream write-up: the existing if (signal) abort block is dead in production because its signal is gated on __NEXT_DEV_SERVER, which prod inlines as ''; and __NEXT_USE_NODE_STREAMS is inlined true for the app bundle, so the Node path is the one that serves production. Co-Authored-By: Claude Opus 5 <[email protected]>
Task 5 checked out PR #96717 in arm B's clone, which would overwrite arm B's dist. Both builds have to survive until the measurement window, because the spec requires all three arms measured back to back under one load profile — and rebuilding an arm mid-window changes the load the other arms were measured under. A second clone is 45s and 416M. Co-Authored-By: Claude Opus 5 <[email protected]>
Task 1 found pkill -f 'next start -p NNNN' can leave the listener up: the wrapper exits and the actual 'next-server' child does not carry the pattern. In the arm loops that is not a tidiness issue — a surviving server means the next arm's suite runs against the PREVIOUS arm's build and reports a confident wrong number, which is exactly the class of silent measurement error this plan exists to avoid. Killing by port cannot miss. (Verified separately that the pattern DID match for undefined ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command "next" not found, so the #376 perf measurement, which used that form, stands.) Tasks 4 and 5 still called probe.mjs, which Task 1 deleted in favour of drive.mjs — and the argument order swapped from id-then-mode to mode-then-id, so those calls would have silently measured the wrong thing rather than failing loudly. Also recorded that drive.mjs needs @playwright/test resolvable from the twin's own directory, since Node resolves ESM bare specifiers from the importing file, not from cwd. Co-Authored-By: Claude Opus 5 <[email protected]>
Task 5 Step 1 said 'cd $NEXTSRC' — a variable that does not exist — and omitted the clone entirely, because it was written assuming one shared checkout. Run from a shell where Task 3 had executed, cwd would still be arm B's clone, so it would have checked #96717 out on top of arm B and destroyed it. Both arms would then have measured the same build and agreed, which is the most convincing possible form of a wrong answer. Arm C also corrected arm B's recorded claim: stream-ops.node.ts is not byte-identical between v16.3.0 and the merge-base (a 2-line unrelated drift in continueFizzStream). The patched REGION is identical. The upstream write-up must make that distinction rather than overclaim. Tightened the diff expectation from '~95/~12' to an equality gate; it held exactly on both arms. Co-Authored-By: Claude Opus 5 <[email protected]>
Both PRs eliminate the error (0/0/0 across three suite runs each) against a 28-42 baseline, and both preserve render cancellation — the distinction the error count alone could not make, and the reason the cancellation twin existed. The load confound was real enough to check: the PR arms ran at load 5-8 while the first baseline ran at 13-25, and lower load narrows the window a disconnect can land in. Re-measuring the unmodified baseline under the quiet load still gave 28, so the zeros are the patches. Two plan assumptions were wrong. A link:ed Next build cannot be used — Turbopack refuses to compile files outside the workspace root, so its resolution fails even though Node's succeeds. And pnpm install silently moved ^16.3.0 to 16.3.1, which would have made an arm partly a version bump; that accident also established that 16.3.1 does not carry either fix. Co-Authored-By: Claude Opus 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Vercel preview readyPreview: https://pretable-67sceksr3-cacheplane.vercel.app Updated automatically by the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The design and implementation plan behind the validation posted to vercel/next.js#96704, and recorded in #377.
Docs only — no source changes.
Outcome
Both open upstream PRs eliminate the
destination stream closed earlynoise (0/0/0 across three suite runs each, against a 28–42 baseline) and both preserve render cancellation.That second half is the part worth keeping. Zero errors is also what you'd get from a fix that stopped cancelling renders while quietly burning server time finishing responses nobody reads. The plan's "cancellation twin" separates those, and it is the check neither PR's own test currently provides.
Why the plan is committed with its failures visible
The plan was wrong in eight places, and every one was caught by a gate rather than by a number that looked plausible:
link:ing a built Next cannot work: Turbopack refuses to compile files outside the workspace root, so its resolution fails even though Node's succeeds.pnpm installsilently moved^16.3.0to 16.3.1, which would have made an arm partly a version bump. That accident established 16.3.1 does not carry either fix.pnpm --filter next buildfails on missing workspace deps; turbo's build task is required.pkill -f "next start"can leave the listener alive, so an arm can silently measure the previous arm's build.Kept rather than tidied away, because the corrections are the reusable part.
Raw logs live outside the repo at
/Users/blove/repos/next-abort-results.🤖 Generated with Claude Code