Closed
Description
Link to the code that reproduces this issue
https://github.com/roksui/my-nextagram
To Reproduce
- Clone the repository and checkout to the master branch.
- Start the applicatin in dev mode using
npm run dev
. - Go to "/login" page and press the Login button.
- Click on photo 1 and inside the modal click on the add comment button.
- The parallel route behind the modal loses its active state and turns blank.
Current vs. Expected behavior
I expected the parallel route segment behind the modal to not lose its active state when the router cache is cleared when calling revalidateTag
in a server action which should only update the data inside the modal. However, I observed that while the data is successfully revalidated in the modal, the parallel route behind the modal loses its active state.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Available memory (MB): 32545
Available CPU cores: 16
Binaries:
Node: 18.17.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.3.0-canary.9 // Latest available version is detected (14.3.0-canary.9).
eslint-config-next: 14.1.1-canary.52
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Parallel & Intercepting Routes
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
- This bug was introduced in 14.3.0-canary.5 (supposedly with the PR fix refresh behavior for discarded actions #64532).
- When looking at the Chrome dev tool's network tab when clicking on the button for adding a comment, after
revalidateTag("comments")
is called, the browser receives a RSC payload for the "/login" route. Now, when I removeredirect("/")
inside the server action for the login, this RSC payload is not received after clicking on the add comment button. - If I use a version before 14.3.0-canary.5, the background segment doesn't lose its active state, however occasionally, the comment list is not revalidated and updated in the modal straight away.