Skip to content

Release the instant navs lock without clearing the whole cookie jar#94947

Merged
unstubbable merged 1 commit into
canaryfrom
hl/enabled-disabled-instant-test
Jun 23, 2026
Merged

Release the instant navs lock without clearing the whole cookie jar#94947
unstubbable merged 1 commit into
canaryfrom
hl/enabled-disabled-instant-test

Conversation

@unstubbable

@unstubbable unstubbable commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

The instant() helper in @next/playwright released the navigation lock by calling page.context().clearCookies({ name: INSTANT_COOKIE }). Playwright implements a filtered clearCookies non-atomically: it clears the entire cookie jar and then re-adds the cookies that don't match the filter, briefly removing the application's own cookies too. Because Next.js reacts to the instant cookie's deletion by immediately re-rendering (a soft refresh or a full reload), a render whose request raced that empty window observed none of the test's cookies, so a page reading cookies() rendered as if nothing was set, for example testCookie: not set. Resource contention widened the clear-then-re-add window, which is why the instant navigation suite failed intermittently in CI.

empty cookie jar

We now release the lock by reading the instant cookie's stored entries (Next.js may have updated the value, e.g. from [0] to [1, null], but preserves the domain and path) and re-adding each with a past expiry, which deletes only those entries and leaves every other cookie untouched. This removes the transient empty-jar window while still firing the CookieStore deletion event that releases the lock.

To exercise the fix under the conditions that surfaced it, we want CI's flake-detection job to replay the instant navigation suite, which only happens when the suite's test file changes. We trigger that by un-skipping the renders runtime-prefetched content instantly during navigation test. That test had been skipped as flaky because of a real bug in the dev runtime-prefetch decode, which #94866 has since fixed, so it passes reliably now and no longer needs to be skipped.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Stats from current PR

✅ No significant changes detected

📊 All Metrics
📖 Metrics Glossary

Dev Server Metrics:

  • Listen = TCP port starts accepting connections
  • First Request = HTTP server returns successful response
  • Cold = Fresh build (no cache)
  • Warm = With cached build artifacts

Build Metrics:

  • Fresh = Clean build (no .next directory)
  • Cached = With existing .next directory

Change Thresholds:

  • Time: Changes < 50ms AND < 10%, OR < 2% are insignificant
  • Size: Changes < 1KB AND < 1% are insignificant
  • All other changes are flagged to catch regressions

⚡ Dev Server

Metric Canary PR Change Trend
Cold (Listen) 811ms 811ms █████
Cold (Ready in log) 786ms 788ms █▇▇▇█
Cold (First Request) 1.193s 1.198s ▅▄▃▂▅
Warm (Listen) 810ms 810ms █████
Warm (Ready in log) 785ms 785ms █▇▇▇█
Warm (First Request) 605ms 605ms ▇▆▅▅▇
📦 Dev Server (Webpack) (Legacy)

📦 Dev Server (Webpack)

Metric Canary PR Change Trend
Cold (Listen) 811ms 810ms █████
Cold (Ready in log) 783ms 783ms ▆▇█▆▆
Cold (First Request) 3.185s 3.209s ▄▄█▅▃
Warm (Listen) 811ms 811ms █████
Warm (Ready in log) 785ms 785ms ▆▆█▆▆
Warm (First Request) 3.244s 3.224s ▄▄█▆▄

⚡ Production Builds

Metric Canary PR Change Trend
Fresh Build 4.950s 4.973s █▆▆▄█
Cached Build 5.018s 4.958s ▆▄▄▄▆
📦 Production Builds (Webpack) (Legacy)

📦 Production Builds (Webpack)

Metric Canary PR Change Trend
Fresh Build 24.364s 24.711s █▆▃▄▂
Cached Build 24.346s 24.380s ▇▆█▆▅
node_modules Size 512 MB 512 MB ▁▁▁▁▁
📦 Bundle Sizes

Bundle Sizes

⚡ Turbopack

Client

Main Bundles
Canary PR Change
0-mcv7ciuqrg0.js gzip 156 B N/A -
019uvq59k1xsr.js gzip 7.65 kB N/A -
03gmyxr7dukvs.js gzip 10.3 kB N/A -
040t1q17lo593.js gzip 8.77 kB N/A -
0434rgrfiw-e-.js gzip 157 B N/A -
091b4qwg0gu-w.js gzip 170 B N/A -
0bb0vtp8dwsez.js gzip 450 B N/A -
0cz1d0mv5g_q7.js gzip 39.4 kB 39.4 kB
0nxqz3q165m2l.js gzip 220 B N/A -
0oo2x5w7yngfe.js gzip 52.4 kB N/A -
0qr-1tnb7_hg5.js gzip 5.72 kB N/A -
0sub5km2z_5h0.js gzip 71 kB N/A -
0uilzvklme4ea.js gzip 8.76 kB N/A -
0z0y83mfx-l-h.js gzip 10 kB N/A -
11yoe4u-n_rqx.js gzip 156 B N/A -
15ok8ydf274z0.js gzip 10.6 kB N/A -
16cqqcigykfea.js gzip 13.6 kB N/A -
16dvwmuhbigar.js gzip 156 B N/A -
17h18zxt1915l.js gzip 1.46 kB N/A -
1aja8kdjwngks.js gzip 155 B N/A -
1elt1qium-r2m.css gzip 115 B 115 B
1fq1h7dxad4cv.js gzip 9.44 kB N/A -
1fym-adbk_69_.js gzip 13.1 kB N/A -
1gav7nfh4y8ln.js gzip 8.76 kB N/A -
1gbkhuqyi9pm_.js gzip 154 B N/A -
1gu5s18w96_6e.js gzip 156 B N/A -
26-odflrnhyhy.js gzip 160 B N/A -
287qr8qup6tiy.js gzip 156 B N/A -
2ipt5xpyn13ef.js gzip 12.9 kB N/A -
2pw50d-8noh_u.js gzip 161 B N/A -
2rypqffktcxqh.js gzip 8.69 kB N/A -
2uqsizxtehgqf.js gzip 8.79 kB N/A -
2vzktdqwbijqc.js gzip 8.74 kB N/A -
328suvp33ui1b.js gzip 153 B N/A -
38s8cut-9h6cn.js gzip 65.5 kB N/A -
3c244akvx_-be.js gzip 8.74 kB N/A -
3dmlemitx3ef3.js gzip 2.29 kB N/A -
3go6lbne9usyq.js gzip 14.1 kB N/A -
3n5__-s7x6aen.js gzip 157 B N/A -
4237vdj6eyslt.js gzip 8.7 kB N/A -
turbopack-06..11dq.js gzip 3.74 kB N/A -
turbopack-0d..1jm9.js gzip 3.74 kB N/A -
turbopack-0i..tsk9.js gzip 3.74 kB N/A -
turbopack-0q..tcei.js gzip 3.74 kB N/A -
turbopack-0s..p2zq.js gzip 3.74 kB N/A -
turbopack-1m..nggg.js gzip 3.74 kB N/A -
turbopack-1t..3lrs.js gzip 3.74 kB N/A -
turbopack-2o..tw3l.js gzip 3.74 kB N/A -
turbopack-2q..dv3t.js gzip 3.74 kB N/A -
turbopack-31..i85n.js gzip 3.74 kB N/A -
turbopack-36..yd90.js gzip 3.75 kB N/A -
turbopack-3c..ua5h.js gzip 3.72 kB N/A -
turbopack-3u..j3of.js gzip 3.74 kB N/A -
turbopack-44..o3m5.js gzip 3.74 kB N/A -
00tc16j5-eos9.js gzip N/A 1.46 kB -
09n7dopcqow7m.js gzip N/A 7.65 kB -
0gaw1gmpwuwkn.js gzip N/A 8.8 kB -
0gh8aejsawyoi.js gzip N/A 154 B -
0jwv4g-50qcpl.js gzip N/A 164 B -
0nik11bmqjjri.js gzip N/A 65.5 kB -
12zyjjmq4oad1.js gzip N/A 5.72 kB -
149501fw_pvo0.js gzip N/A 154 B -
1ex7xcg220yut.js gzip N/A 154 B -
1k9cc4-gpa2cx.js gzip N/A 13.1 kB -
1n59uogejo81s.js gzip N/A 10.3 kB -
1npei3hlexdv3.js gzip N/A 9.99 kB -
1oi2-ik9ic2zu.js gzip N/A 14.1 kB -
1pmabinmlpk7m.js gzip N/A 12.9 kB -
1ssuiwj_rnpc5.js gzip N/A 8.77 kB -
1zo8pa0dm5bon.js gzip N/A 156 B -
2-phc9obd3nyd.js gzip N/A 8.77 kB -
24utq57r3l1cw.js gzip N/A 8.7 kB -
2f5g24rmb5hn9.js gzip N/A 52.4 kB -
2fhjq6ek3srmr.js gzip N/A 8.69 kB -
2g0t7upz_v-hf.js gzip N/A 10.6 kB -
2ia9qqy99aie9.js gzip N/A 13.6 kB -
2ij8izt99_olj.js gzip N/A 155 B -
2oza28kdqvoay.js gzip N/A 8.74 kB -
2wygttizwkg5m.js gzip N/A 155 B -
2yn5wj9eawg3n.js gzip N/A 158 B -
2zh8-mmhujy8o.js gzip N/A 2.29 kB -
30h_m0irj-q6p.js gzip N/A 221 B -
34x2ip5977ya6.js gzip N/A 71 kB -
37ejbfx1u9lpo.js gzip N/A 8.75 kB -
380fjvuvfio42.js gzip N/A 151 B -
38c63ct4i1cy7.js gzip N/A 449 B -
3g92_n2z1ppe7.js gzip N/A 154 B -
3i8j10xmt8ojp.js gzip N/A 156 B -
3jimpal3lvz5e.js gzip N/A 9.44 kB -
3ss_0m9d8j96m.js gzip N/A 161 B -
3wb4pe4z4-aim.js gzip N/A 8.77 kB -
43tpmhttptnu5.js gzip N/A 155 B -
turbopack-00..99a7.js gzip N/A 3.74 kB -
turbopack-0e..fhxz.js gzip N/A 3.72 kB -
turbopack-0t..679x.js gzip N/A 3.74 kB -
turbopack-1o..s0ak.js gzip N/A 3.74 kB -
turbopack-1t..hy80.js gzip N/A 3.75 kB -
turbopack-28..utru.js gzip N/A 3.74 kB -
turbopack-2a..72wm.js gzip N/A 3.74 kB -
turbopack-2b..4x_1.js gzip N/A 3.74 kB -
turbopack-2c..4uav.js gzip N/A 3.74 kB -
turbopack-2p..4apo.js gzip N/A 3.74 kB -
turbopack-2z..-atd.js gzip N/A 3.74 kB -
turbopack-34..zy0_.js gzip N/A 3.74 kB -
turbopack-3a..f38l.js gzip N/A 3.74 kB -
turbopack-43..sm9p.js gzip N/A 3.74 kB -
Total 465 kB 465 kB ⚠️ +10 B

Server

Middleware
Canary PR Change
middleware-b..fest.js gzip 730 B 724 B
Total 730 B 724 B ✅ -6 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 429 B 434 B 🔴 +5 B (+1%)
Total 429 B 434 B ⚠️ +5 B

📦 Webpack

Client

Main Bundles
Canary PR Change
2486.HASH.js gzip 169 B N/A -
3146-HASH.js gzip 62.7 kB N/A -
39fcf99b-HASH.js gzip 62.9 kB N/A -
8443-HASH.js gzip 4.68 kB N/A -
9431-HASH.js gzip 5.62 kB N/A -
framework-HASH.js gzip 59.8 kB 59.8 kB
main-app-HASH.js gzip 255 B 254 B
main-HASH.js gzip 39.4 kB 39.8 kB 🔴 +436 B (+1%)
webpack-HASH.js gzip 1.68 kB 1.68 kB
6105-HASH.js gzip N/A 5.63 kB -
764.HASH.js gzip N/A 169 B -
8898-HASH.js gzip N/A 62.2 kB -
9597-HASH.js gzip N/A 4.65 kB -
e1ccab69-HASH.js gzip N/A 62.9 kB -
Total 237 kB 237 kB ✅ -163 B
Polyfills
Canary PR Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Total 39.4 kB 39.4 kB
Pages
Canary PR Change
_app-HASH.js gzip 194 B 194 B
_error-HASH.js gzip 183 B 182 B
css-HASH.js gzip 335 B 335 B
dynamic-HASH.js gzip 1.8 kB 1.8 kB
edge-ssr-HASH.js gzip 255 B 254 B
head-HASH.js gzip 351 B 349 B
hooks-HASH.js gzip 384 B 384 B
image-HASH.js gzip 580 B 581 B
index-HASH.js gzip 259 B 259 B
link-HASH.js gzip 2.49 kB 2.49 kB
routerDirect..HASH.js gzip 319 B 319 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 315 B 313 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Total 7.96 kB 7.95 kB ✅ -6 B

Server

Edge SSR
Canary PR Change
edge-ssr.js gzip 126 kB 127 kB
page.js gzip 280 kB 281 kB
Total 407 kB 408 kB ⚠️ +1.38 kB
Middleware
Canary PR Change
middleware-b..fest.js gzip 617 B 619 B
middleware-r..fest.js gzip 156 B 155 B
middleware.js gzip 44.7 kB 44.8 kB
edge-runtime..pack.js gzip 842 B 842 B
Total 46.3 kB 46.5 kB ⚠️ +103 B
Build Details
Build Manifests
Canary PR Change
_buildManifest.js gzip 719 B 719 B
Total 719 B 719 B
Build Cache
Canary PR Change
0.pack gzip 4.58 MB 4.57 MB 🟢 12.2 kB (0%)
index.pack gzip 112 kB 115 kB 🔴 +2.28 kB (+2%)
index.pack.old gzip 113 kB 112 kB 🟢 1.39 kB (-1%)
Total 4.81 MB 4.8 MB ✅ -11.3 kB

🔄 Shared (bundler-independent)

Runtimes
Canary PR Change
app-page-exp...dev.js gzip 360 kB 360 kB
app-page-exp..prod.js gzip 198 kB 198 kB
app-page-tur...dev.js gzip 359 kB 359 kB
app-page-tur..prod.js gzip 198 kB 198 kB
app-page-tur...dev.js gzip 356 kB 356 kB
app-page-tur..prod.js gzip 196 kB 196 kB
app-page.run...dev.js gzip 356 kB 356 kB
app-page.run..prod.js gzip 196 kB 196 kB
app-route-ex...dev.js gzip 78.4 kB 78.4 kB
app-route-ex..prod.js gzip 52.9 kB 52.9 kB
app-route-tu...dev.js gzip 78.4 kB 78.4 kB
app-route-tu..prod.js gzip 53 kB 53 kB
app-route-tu...dev.js gzip 78 kB 78 kB
app-route-tu..prod.js gzip 52.7 kB 52.7 kB
app-route.ru...dev.js gzip 78 kB 78 kB
app-route.ru..prod.js gzip 52.7 kB 52.7 kB
dist_client_...dev.js gzip 324 B 324 B
dist_client_...dev.js gzip 326 B 326 B
dist_client_...dev.js gzip 318 B 318 B
dist_client_...dev.js gzip 317 B 317 B
pages-api-tu...dev.js gzip 45.1 kB 45.1 kB
pages-api-tu..prod.js gzip 33.8 kB 33.8 kB
pages-api.ru...dev.js gzip 45.1 kB 45.1 kB
pages-api.ru..prod.js gzip 33.8 kB 33.8 kB
pages-turbo....dev.js gzip 54.5 kB 54.5 kB
pages-turbo...prod.js gzip 39.5 kB 39.5 kB
pages.runtim...dev.js gzip 54.5 kB 54.5 kB
pages.runtim..prod.js gzip 39.5 kB 39.5 kB
server.runti..prod.js gzip 64.6 kB 64.6 kB
use-cache-pr...dev.js gzip 71 kB 71 kB
use-cache-pr...dev.js gzip 71 kB 71 kB
use-cache-pr...dev.js gzip 69.3 kB 69.3 kB
use-cache-pr...dev.js gzip 69.3 kB 69.3 kB
Total 3.43 MB 3.43 MB
📎 Tarball URL
https://vercel-packages.vercel.app/next/commits/d1d36eb0954702af53ede95c423dfde7eed9c2a6/next

Commit: d1d36eb

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: d1d36eb

@unstubbable unstubbable changed the title [test] Un-skip runtime-prefetched instant navigation test Jun 18, 2026
@unstubbable unstubbable force-pushed the hl/enabled-disabled-instant-test branch from 11cffb8 to f56e2ac Compare June 18, 2026 18:54
@unstubbable unstubbable marked this pull request as ready for review June 18, 2026 20:47
@unstubbable unstubbable requested a review from acdlite June 18, 2026 20:47
@unstubbable unstubbable force-pushed the hl/enabled-disabled-instant-test branch 2 times, most recently from 59ffcbc to 3a1f8b1 Compare June 22, 2026 21:58
The `instant()` helper in `@next/playwright` released the navigation
lock by calling `page.context().clearCookies({ name: INSTANT_COOKIE })`.
Playwright implements a filtered `clearCookies` non-atomically: it
clears the entire cookie jar and then re-adds the cookies that don't
match the filter, briefly removing the application's own cookies too.
Because Next.js reacts to the instant cookie's deletion by immediately
re-rendering (a soft refresh or a full reload), a render whose request
raced that empty window observed none of the test's cookies, so a page
reading `cookies()` rendered as if nothing was set, for example
`testCookie: not set`. Resource contention widened the clear-then-re-add
window, which is why the instant navigation suite failed intermittently
in CI.

We now release the lock by reading the instant cookie's stored entries
(Next.js may have updated the value, e.g. from `[0]` to `[1, null]`, but
preserves the domain and path) and re-adding each with a past expiry,
which deletes only those entries and leaves every other cookie
untouched. This removes the transient empty-jar window while still
firing the CookieStore deletion event that releases the lock.

To exercise the fix under the conditions that surfaced it, we want CI's
flake-detection job to replay the instant navigation suite, which only
happens when the suite's test file changes. We trigger that by
un-skipping the `renders runtime-prefetched content instantly during
navigation` test. That test had been skipped as flaky because of a real
bug in the dev runtime-prefetch decode, which #94866 has since fixed, so
it passes reliably now and no longer needs to be skipped.
@unstubbable unstubbable force-pushed the hl/enabled-disabled-instant-test branch from 3a1f8b1 to d1d36eb Compare June 23, 2026 19:07
@unstubbable unstubbable merged commit 82cd994 into canary Jun 23, 2026
129 checks passed
@unstubbable unstubbable deleted the hl/enabled-disabled-instant-test branch June 23, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants