We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React version: 18.2.0
p
"use server"; export async function serverAction(p: Promise<void>) { console.log(p); const t1 = new Date(); await p; const t2 = new Date(); console.log("elapsed", t2.valueOf() - t1.valueOf()); return { t1, t2, }; }
new Promise((r) => setTimeout(r, 10_000))
Link to code example:
https://codesandbox.io/p/devbox/next-14-0-3-forked-7q86s7?file=%2Fapp%2Factions.ts%3A4%2C18&workspaceId=958ee911-ec8f-4ca3-9ce1-668005ecaeb8
Serialization of promises is synchronous and blocking.
That a promise could be passed to a server action and resolved asynchronously, e.g., as a cancellation token.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
React version: 18.2.0
Steps To Reproduce
p
:new Promise((r) => setTimeout(r, 10_000))
to that server action.Link to code example:
https://codesandbox.io/p/devbox/next-14-0-3-forked-7q86s7?file=%2Fapp%2Factions.ts%3A4%2C18&workspaceId=958ee911-ec8f-4ca3-9ce1-668005ecaeb8
The current behavior
Serialization of promises is synchronous and blocking.
The expected behavior
That a promise could be passed to a server action and resolved asynchronously, e.g., as a cancellation token.
The text was updated successfully, but these errors were encountered: