-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
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
[🐞] Running multiple action$ simultaneously only runs one #3334
Comments
Here's workaround I found for this issue: Define the function that serializes execution of actions. let prevAction = Promise.resolve();
export const enqueueAction = async (action, ...args) => {
await prevAction;
return prevAction = action.run(...args);
}; Then call it instead of // foo.run(args)
// bar.run(args)
enqueuAction(foo, args)
enqueuAction(bar, args) |
man, I was going nuts with this issue anyway, this solution seemed to work for me
which is kinda simpler |
I think this is a simple and elegant solution. |
But this is not "simultaneously", they are sequential. I have no context about this discussion, tho. |
well, yes, but at least it works for some cases. But the thing that an action can interrupt other actions is a bummer |
Hello team! Just let me know I'm wrong Thanks! |
Which component is affected?
Qwik City (routing)
Describe the bug
Doing:
Trying to
run()
multiple actions when a button is clicked.Expect:
These actions have run.
Happened:
Randomly selected only one action has run.
Reproduction
https://github.com/genki/qwik-test/tree/no_multi_actions
Steps to reproduce
git clone
the the above andnpm run dev
The reproduction code is in
src/router/index.tsx
Please note this expects the latest qwik is located
~/project/clone/qwik
System Info
Additional Information
I faced this issue as well at other situation such that several actions run at the same timing.
For example, when one signal triggers several
useTask$
at once and each of them runs different actions.The text was updated successfully, but these errors were encountered: