The issue involves complex Suspense and revalidation timing interactions in production mode.
The UI fails to update after revalidatePath when a short-duration promise exists in Suspense, but works correctly without it. The bug appears production-only and requires understanding of Suspense behavior and Next.js revalidation. The reproduction steps are clear but the fix likely involves React's streaming or hydration timing.
https://github.com/TomLaVachette/next-short-promise-issue
To verify the fix: Comment out the block in app/page.tsx (lines 25-27). The counter will now update correctly after clicking "Increment".
https://github.com/user-attachments/assets/10f90744-9b14-471a-8cbc-b5ed91cdb2ea
Current behavior: When a server action calls revalidatePath('/') on a page containing a very short async component (<5ms) wrapped in Suspense, the client UI does not update to reflect the new server state. The console logs prove that:
Yet the DOM is not updated. The UI remains "stuck" showing stale data until any client-side state change (like toggling a useState) forces a re-render.
Expected behavior: After revalidatePath('/') completes, the client UI should update to display the new counter value (e.g., counter: 1) without requiring any manual intervention or client-side state change.
Key observation: The bug only occurs when a short-duration promise (~5ms) exists in a Suspense boundary. Removing the WaitingPromise component resolves the issue.
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!