rsnext/test
Zack Tanner 5309c30c7d
make router restore action resilient to a missing tree (#62098)
### What
Following an anchor link to a hash param, and then attempting to use
`history.pushState` or `history.replaceState`, would result in an MPA
navigation to the targeted URL.

### Why
In #61822, a guard was added to prevent calling `ACTION_RESTORE` with a
missing tree, to match other call-sites where we do the same. This was
to prevent the app from crashing in the case where app router internals
weren't available in the history state. The original assumption was that
this is a rare / unlikely edge case. However the above scenario is a
very probable case where this can happen, and triggering an MPA
navigation isn't ideal.

### How
This updates `ACTION_RESTORE` to be resilient to an undefined router
state tree. When this happens, we'll still trigger the restore action to
sync params, but use the existing flight router state.

Closes NEXT-2502
2024-02-15 14:10:29 +00:00
..
.stats-app Reduce memory/cache overhead from over loader processing (#62005) 2024-02-13 22:40:19 +00:00
development Add dev option to Turbopack createProject() (#62083) 2024-02-15 13:50:08 +01:00
e2e make router restore action resilient to a missing tree (#62098) 2024-02-15 14:10:29 +00:00
examples feat(cli): introduce --tailwind flag (#46927) 2023-03-16 16:06:27 +01:00
integration update turbopack (#62080) 2024-02-15 12:41:26 +01:00
lib refactor(tests): make chain more "correct" (#51728) 2024-02-14 20:14:24 +01:00
production refactor(tests): make chain more "correct" (#51728) 2024-02-14 20:14:24 +01:00
unit fix:(next/image) handle remotePatterns with a dot in the pathname (#60488) 2024-02-08 18:21:29 -05:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-tests-manifest.d.ts Update Turbopack test manifest from GitHub Actions artifact (#58394) 2023-11-24 16:48:12 +01:00
build-turbopack-tests-manifest.js test(fixture): fix manifest update (#61970) 2024-02-12 15:26:30 -08:00
get-test-filter.js run tests from test suite that are not listed in the manifest (#58401) 2024-01-11 07:38:35 +00:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
ppr-tests-manifest.json Navigation Signals in PPR (#60450) 2024-02-06 12:25:50 -07:00
readme.md
test-file.txt
tsconfig.json chore: extends from shared base tsconfig (#59776) 2023-12-19 18:52:22 +01:00
turbopack-tests-manifest.json fix(next-core): apply image-loader alias to the remaining context (#62070) 2024-02-14 20:21:16 -08:00

See Testing for more information on how you can run/write/debug tests for Next.js.