You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Transition deadlock when navigating and double calling server action #84299
I've investigated this issue and identified the root cause in the action queue logic.
The Issue:
When a navigation action is dispatched while a server action is pending, the pending action is correctly marked as discarded. However, the discarded action's promise is never resolved within the handleResult function. The function returns early without calling action.resolve(), which leaves the React transition hanging indefinitely and causes the deadlock.
functionhandleResult(nextState: AppRouterState){if(action.discarded){// ... handles revalidation flagrunRemainingActions(actionQueue,setState)return// ❌ BUG: Promise never resolved!}// ...action.resolve(nextState)// ← Only reached if not discarded}
The Fix:
Discarded actions should still resolve their promises (using the current state) even if the result is discarded. This ensures the React transition completes successfully without applying the stale state update.
I am working on a PR to implement this fix now. This should also address related issue #86055.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Activity
Suhaib3100 commentedon Jan 29, 2026
Root Cause Analysis
I've investigated this issue and identified the root cause in the action queue logic.
The Issue:
When a navigation action is dispatched while a server action is pending, the pending action is correctly marked as
discarded. However, the discarded action's promise is never resolved within thehandleResultfunction. The function returns early without callingaction.resolve(), which leaves the React transition hanging indefinitely and causes the deadlock.Relevant Code:
The issue is located in
app-router-instance.ts:The Fix:
Discarded actions should still resolve their promises (using the current state) even if the result is discarded. This ensures the React transition completes successfully without applying the stale state update.
I am working on a PR to implement this fix now. This should also address related issue #86055.
gaearon commentedon Jul 2, 2026
This should get fixed by #95391.
gaearon commentedon Jul 3, 2026
Confirmed this is fixed in
16.3.0-canary.76.github-actions commentedon Sep 7, 2026
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.