rsnext/test/e2e/app-dir/navigation
Zack Tanner 9fb775e2f8
fix refresh behavior for discarded actions (#64532)
When an action is marked as "discarded", we enqueue a refresh, since the
navigation event will be invoked immediately without waiting for the
action to finish. We refresh because it's possible that the discarded
action triggered some sort of mutation/revalidation, and we want the
router to still be able to respond to that new data.

However there's a bug in this logic -- it'll only enqueue the refresh
action if there were no other actions in the queue, ignoring the case
where something is still in the queue. This makes sure that the refresh
is handled after `runRemainingActions` finishes.

When adding a test for the server component case (which doesn't hit this
refresh branch), I noticed `LayoutRouter` caused React to suspend
indefinitely, because it got stuck in the `use(unresolvedThenable)`
case. We should only suspend indefinitely if we kicked off a the
`SERVER_PATCH` action, as otherwise it's possible nothing will ever
break out of that branch.

Fixes #64517
Closes NEXT-3124
2024-04-16 06:56:48 -07:00
..
app fix refresh behavior for discarded actions (#64532) 2024-04-16 06:56:48 -07:00
pages memoize useParams (#56771) 2023-10-13 07:47:05 +00:00
middleware.js Export RedirectType from next/navigation (#54729) 2023-08-29 11:05:44 -07:00
navigation.test.ts fix refresh behavior for discarded actions (#64532) 2024-04-16 06:56:48 -07:00
next.config.js Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00