rsnext/test/e2e/app-dir
Zack Tanner 51549d92de
fix refreshing inactive segments that contained searchParams (#64086)
When adding refresh markers for refetching segments that are "stale"
(the soft navigation case where they are still in the Router State Tree
but not part of the page that we're rendering), they only contained a
reference to the pathname. Once the actual refresh was triggered we
added the current search params to the request.

However, this causes an issue: segments in the `FlightRouterState` can
contain searchParams (ie, `__PAGE__?{"foo": "bar}` is what the segment
becomes when adding `?foo=bar` to a page). This means that when we
refresh those nodes from the server, it won't know how to find the
`CacheNode` for the stale segment since we won't have them in the
refetch tree. This updates to keep a reference to the searchParams that
were part of the request that made it active.

While fixing this, I also noticed that we were missing a spot to add the
refetch marker in `applyRouterStatePatchToTree` in the case of a root
refresh (caught by these tests failing in PPR)


[x-ref](https://github.com/vercel/next.js/discussions/63900#discussioncomment-9002137)

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-3007
2024-04-04 23:44:54 +00:00
..
_allow-underscored-root-directory Add missing rootlayout to allow-underscored-root-directory test (#61137) 2024-01-25 12:40:40 +01:00
actions skip HEAD request in server action redirect (#63819) 2024-03-28 12:54:29 -07:00
actions-allowed-origins Change allowed forwarded hosts to be allowed origins for Server Actions (#58023) 2023-11-08 11:20:32 +01:00
actions-navigation fix loading issue when navigating to page with async metadata (#61687) 2024-02-06 07:10:53 -08:00
app fix: pass nonce to next/script properly (#56995) 2024-04-01 23:27:38 +00:00
app-a11y Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-alias Alias nextjs api entry to esm version for app router (#59852) 2023-12-23 17:46:50 +01:00
app-basepath test: switch order of tests to avoid flakniess (#63482) 2024-03-19 17:36:05 +00:00
app-basepath-custom-server fix: cookie override during redirection from server action (#61633) 2024-04-04 14:08:13 -07:00
app-client-cache add telemetry events for ppr & staleTimes experimental flags (#63981) 2024-04-02 21:11:47 +00:00
app-compilation Add hasRedbox fix (#60522) 2024-01-15 09:36:44 +01:00
app-config-crossorigin fix(#53190): add missing crossOrigin to assetsPrefix resources (#56311) 2023-10-02 17:21:49 +00:00
app-css New CSS chunking algorithm (#63157) 2024-03-18 10:29:13 +01:00
app-css-pageextensions Use consistent name for App Router tests (#56352) 2023-10-06 11:06:06 +02:00
app-custom-cache-handler Stabilize custom cache handlers and changing memory size. (#57953) 2024-01-17 23:42:52 +01:00
app-edge Tree shake the unused exports in direct relative imported client component module (#62238) 2024-02-20 17:07:25 +01:00
app-edge-root-layout Fix static metadata routes runtime when root layout is in edge runtime (#50351) 2023-05-25 15:39:57 -07:00
app-esm-js Support next/og usage in ESM nextjs app (#60818) 2024-01-18 13:44:50 +01:00
app-external Skip worker test in Turbopack (#63398) 2024-03-18 10:31:38 +01:00
app-fetch-deduping feat(log): improve dev/build logs (#62946) 2024-03-26 15:33:09 +01:00
app-invalid-revalidate Add unstable_cache validate test case (#59828) 2023-12-20 18:00:23 -06:00
app-middleware Use consistent name for App Router tests (#56352) 2023-10-06 11:06:06 +02:00
app-prefetch only prefix prefetch cache entries if they vary based on Next-URL (#61235) 2024-02-13 15:03:37 +00:00
app-prefetch-false Rename process.env.TURBOPACK -> process.env.TURBOPACK_DEV in test skips (#63665) 2024-03-25 14:17:56 +01:00
app-prefetch-false-loading chore: Fix multiple typos (#60531) 2024-01-11 10:44:55 -08:00
app-prefetch-static Reland static prefetches & fix prefetch bailout behavior (#56228) 2023-10-02 17:12:55 +00:00
app-rendering Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-routes Fix abort condition for requests (#64000) 2024-04-02 15:30:13 -07:00
app-routes-subrequests fix: allow some recursion for middleware subrequests (#60615) 2024-02-06 18:00:29 +00:00
app-routes-trailing-slash Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
app-simple-routes Turbopack: add edge app routes (#53387) 2023-08-07 13:00:06 +02:00
app-static Ensure unstable_cache bypasses for draft mode (#64007) 2024-04-03 08:08:28 -07:00
app-validation Use consistent name for App Router tests (#56352) 2023-10-06 11:06:06 +02:00
asset-prefix fix: bundle fetching with asset prefix (#63627) 2024-03-29 16:38:24 -07:00
asset-prefix-with-basepath fix: bundle fetching with asset prefix (#63627) 2024-03-29 16:38:24 -07:00
async-component-preload Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
autoscroll-with-css-modules Skip Babel tests for Turbopack (#56091) 2023-09-27 16:12:43 +02:00
back-button-download-bug chore(next/image)!: mark domains as deprecated in favor remotePatterns (#57062) 2023-10-19 20:24:48 +00:00
build-size Improve performance of String.prototype.split uses (#56746) 2023-10-19 00:25:15 +00:00
chunk-loading App Router - preinitialize chunks during SSR (#54752) 2023-10-03 21:40:25 +00:00
conflicting-page-segments fix parallel catch-all route normalization (#59791) 2023-12-22 09:30:23 -08:00
create-root-layout refactor(next): fix spacing on auto-generated root layout (#62769) 2024-03-05 19:47:57 +00:00
crypto-globally-available Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
css-order New CSS chunking algorithm (#63157) 2024-03-18 10:29:13 +01:00
draft-mode Allow next/headers in middleware & draftMode in edge runtime (#53465) 2023-08-02 20:22:35 +00:00
dynamic Fix next dynamic import named export from client components (#61378) 2024-01-31 14:50:20 +01:00
dynamic-data DX: add route context to dynamic errors for app routes (#62844) 2024-03-08 11:35:24 -07:00
dynamic-href Add hasRedbox fix (#60522) 2024-01-15 09:36:44 +01:00
dynamic-in-generate-params Remove the erroring on force-dynamic in static generation for app route (#63526) 2024-03-22 00:15:20 +01:00
dynamic-interception-route-revalidate fix router revalidation behavior for dynamic interception routes (#63768) 2024-03-28 13:35:22 +00:00
dynamic-requests ignore fully dynamic requests on server side (#62949) 2024-03-11 08:41:33 +00:00
edge-route-catchall fix edge route catch-all param parsing (#59343) 2023-12-06 12:21:28 -08:00
edge-route-rewrite fix rewrites to edge routes (#58797) 2023-11-23 05:25:00 +00:00
edge-runtime-node-compatibility Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
emotion-js Fix emotion-js transform for server components (#54284) 2023-08-20 03:14:16 +00:00
error-boundary-navigation Fix root not-found page tree loader structure (#54080) 2023-08-16 15:10:08 +00:00
errors Associate server error digest with browser logged one (#61592) 2024-02-06 13:39:12 +01:00
front-redirect-issue Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
global-error Add hasRedbox fix (#60522) 2024-01-15 09:36:44 +01:00
headers-static-bailout Add docs page for uncaught DynamicServerErrors (#53402) 2023-08-08 12:49:53 +02:00
hello-world Bail out of 404 page when favicon.ico doesn't exist (#50795) 2023-06-06 10:58:40 +02:00
hooks More hot-reloader-turbopack refactors (#62055) 2024-02-15 08:53:36 +01:00
i18n-hybrid Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
import Use consistent name for App Router tests (#56352) 2023-10-06 11:06:06 +02:00
interception-dynamic-segment fix interception routes with dynamic segments (#59273) 2023-12-05 08:47:40 -08:00
interception-middleware-rewrite fix behavior when revisiting an intercepted route (#59168) 2023-12-01 08:54:01 -08:00
interception-route-prefetch-cache Fix test flake (#62379) 2024-02-22 00:19:49 -08:00
interception-routes-root-catchall fix parallel catch-all route normalization (#59791) 2023-12-22 09:30:23 -08:00
interoperability-with-pages improve error DX on pages with RSC build errors (#52843) 2023-07-20 00:32:57 +00:00
layout-params Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
logging fix(log): skip logging non-route requests (#63973) 2024-04-03 12:16:20 +02:00
mdx Fix client reference proxies (#57301) 2023-10-24 00:24:22 +00:00
metadata fix: default relative canonical url should not contain search (#63843) 2024-03-28 23:16:22 +00:00
metadata-dynamic-routes feat: add support for localizations in sitemap generator (#53765) 2024-03-20 17:00:20 +00:00
metadata-edge types: cover the tests with root tsconfig.json (#59550) 2023-12-13 11:55:02 +01:00
metadata-json-manifest Fix metadata json manifest convention (#62615) 2024-02-28 00:55:27 +01:00
metadata-suspense Remove throw for unknown messages in hot-reloader-client (#57353) 2023-11-03 01:06:53 +00:00
metadata-warnings fix: avoid metadata viewport warning during manually merging metadata (#63845) 2024-03-29 00:32:22 +00:00
missing-suspense-with-csr-bailout Rename process.env.TURBOPACK -> process.env.TURBOPACK_DEV in test skips (#63665) 2024-03-25 14:17:56 +01:00
mjs-as-extension Enable .mjs extension config in Turbopack (#58825) 2023-11-23 14:17:36 +00:00
modularizeimports Fix bugs with baseUrl and mdxRs (#58968) 2023-11-28 10:50:14 +01:00
navigation fix double redirect when using a loading boundary (#63786) 2024-03-28 16:08:39 -07:00
next-config Avoid loading Next.js config again in render workers (#52587) 2023-07-12 11:21:05 +00:00
next-font build: Update turbopack (#63229) 2024-03-13 10:13:56 +00:00
next-image refactor(test): switch tests to use pnpm in more places (#63196) 2024-03-20 15:00:58 -04:00
not-found Fix status code for /_not-found route (#64058) 2024-04-04 17:35:27 +02:00
not-found-default Fix status code for /_not-found route (#64058) 2024-04-04 17:35:27 +02:00
pages-to-app-routing Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
parallel-route-not-found log a dev warning when a missing parallel slot results in a 404 (#60186) 2024-01-04 07:56:20 -08:00
parallel-route-not-found-params Fix TypeError when using params in RootLayout with parallel routes (#60401) 2024-01-09 07:06:24 -08:00
parallel-routes-and-interception Fix empty white page with parallel routes + loading boundaries (#61597) 2024-02-12 16:30:52 -08:00
parallel-routes-and-interception-basepath Fix intercepted segments with basepath (#60485) 2024-01-10 13:18:00 -08:00
parallel-routes-catchall parallel routes: fix catch-all slots being treated as optional catch-all (#61174) 2024-01-30 15:28:47 -08:00
parallel-routes-catchall-children-slot parallel routes: fix @children slots (#60288) 2024-01-06 07:24:44 -08:00
parallel-routes-catchall-default fix parallel route top-level catch-all normalization logic to support nested explicit (non-catchall) slot routes (#60776) 2024-01-23 22:11:13 +00:00
parallel-routes-catchall-dynamic-segment fix parallel route top-level catch-all normalization logic to support nested explicit (non-catchall) slot routes (#60776) 2024-01-23 22:11:13 +00:00
parallel-routes-catchall-groups fix parallel catch-all route normalization (#59791) 2023-12-22 09:30:23 -08:00
parallel-routes-catchall-slotted-non-catchalls fix parallel route top-level catch-all normalization logic to support nested explicit (non-catchall) slot routes (#60776) 2024-01-23 22:11:13 +00:00
parallel-routes-catchall-specificity fix logic error in parallel route catch-all normalization (#63879) 2024-04-01 08:50:54 -07:00
parallel-routes-layouts parallel routes: support multi-slot layouts (#61115) 2024-01-26 11:46:23 -08:00
parallel-routes-not-found Recover not found errors from flight data to render with proper boundary (#53703) 2023-08-12 08:41:47 +00:00
parallel-routes-revalidation fix refreshing inactive segments that contained searchParams (#64086) 2024-04-04 23:44:54 +00:00
parallel-routes-use-selected-layout-segment fix useSelectedLayoutSegment's support for parallel routes (#60912) 2024-01-23 15:53:45 -08:00
params-hooks-compat Enable missing suspense bailout by default (#60840) 2024-01-18 21:11:22 +01:00
ppr add telemetry events for ppr & staleTimes experimental flags (#63981) 2024-04-02 21:11:47 +00:00
ppr-errors Rename process.env.TURBOPACK -> process.env.TURBOPACK_DEV in test skips (#63665) 2024-03-25 14:17:56 +01:00
ppr-full Support resuming a complete HTML prerender that has dynamic flight data (#60865) 2024-02-12 15:59:13 -08:00
ppr-navigations [PPR Nav] Fix flash of loading state during back/forward (#60578) 2024-01-12 14:18:54 -05:00
prefetching-not-found fix navigation applying stale data when triggered from global not found (#62033) 2024-02-14 10:46:31 -08:00
resolve-extensions add turbo.resolveExtensions to allow to customize extensions (#62004) 2024-02-19 09:07:09 +00:00
revalidate-dynamic feat(log): improve dev/build logs (#62946) 2024-03-26 15:33:09 +01:00
rewrites-redirects Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
root-layout Add hasRedbox fix (#60522) 2024-01-15 09:36:44 +01:00
root-layout-redirect Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
root-layout-render-once Ensure root layout only render once per request (#52589) 2023-07-13 17:34:31 +02:00
route-page-manifest-bug Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
router-autoscroll chore(test): fix false-positive tests (#63242) 2024-03-21 01:24:33 +01:00
router-stuck-dynamic-static-segment Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
rsc-basic Update swc_core to v0.87.28 (#60876) 2024-01-24 08:05:05 +00:00
scss improve tilde test case (#63470) 2024-03-27 06:16:49 +00:00
search-params-react-key Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
searchparams-static-bailout Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
server-actions-relative-redirect fix server-actions-relative-redirect types (#63985) 2024-04-02 16:57:01 +00:00
server-components-externals Fix handling subpath for server components externals (#62150) 2024-02-16 17:24:12 +01:00
set-cookies Fix mjs import for Turbopack test (#56354) 2023-10-03 13:33:04 +02:00
shallow-routing make router restore action resilient to a missing tree (#62098) 2024-02-15 14:10:29 +00:00
similar-pages-paths Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00
static-generation-status Respect non 200 status to page static generation response (#63731) 2024-03-27 16:20:02 +01:00
syntax-highlighter-crash Increase Rust stack size (#61809) 2024-02-08 10:59:50 +01:00
taint Expose Experimental Taint APIs (#56507) 2023-10-19 19:02:37 -07:00
test-template/{{ toFileName name }} chore: update test template to use nextTestSetup (#62154) 2024-02-16 17:30:54 +01:00
third-parties Fix third party typings (#59503) 2023-12-12 01:07:17 +01:00
trailingslash Fix metadata url cases should not append with trailing slash (#63050) 2024-03-08 21:16:16 +01:00
turbopack-reports Turbopack issue report tests (#61845) 2024-02-10 12:59:31 +01:00
underscore-ignore-app-paths Update default moduleResolution in tsconfig.json from node to bundler (#51957) 2023-07-18 15:11:09 +00:00
use-params FIX [#58788]: Fixed useParams hook undesired re-renders and updated it to use PathParamsContext in the app router. (#60708) 2024-02-14 16:52:44 +00:00
use-selected-layout-segment-s chore: upgrade jest (#56909) 2023-10-19 17:38:24 +00:00
webpack-loader-conditions add conditions for webpack loader rules (#63333) 2024-03-16 21:02:10 +01:00
with-babel Update tests for Turbopack (#59354) 2023-12-07 15:03:44 +01:00
with-exported-function-config chore: upgrade jest (#56909) 2023-10-19 17:38:24 +00:00
x-forwarded-headers fix: handle multiple x-forwarded-proto headers (#58824) 2024-02-14 14:47:26 +01:00