Are server actions guaranteed to run in succession? #51443
Unanswered
codinginflow
asked this question in
App Router
Replies: 1 comment
-
---result--- write_unsafe hello I guess it is not successive😭 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have this code in my app that uses a server action to create a new (anonymous ) shopping cart if the visitor clicks an "add to cart" button and no cart for them exists yet:
I was worried about race conditions when the button is clicked multiple times and it would create multiple new carts. But when I tried it out, the server action wasn't executed multiple times in parallel, but one after another.
So do server actions always execute in succession or is my thinking wrong here?
Beta Was this translation helpful? Give feedback.
All reactions