Updating an async atom twice from a writer atom never resolves #2682
Replies: 2 comments 7 replies
-
Thanks for reporting! |
Beta Was this translation helpful? Give feedback.
2 replies
-
Reproduction with StackBlitz: https://stackblitz.com/edit/vitejs-vite-indg9c?file=src%2FApp.tsx If we add a setTimeout wait, it works. This is a bug, but I'm not sure how easy a fix would be. Would anyone like to try? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug Description
I've found what I think is a bug and have written two test cases that are seemingly equivalent, but where one succeeds and one fails.
The succeding one creates an
atom<Promise<number>>
and a writer atom that increments the promised value twice. All is well.However, if we change the
writer
to use an update function instead:it does not work. Some
console.log
debugging shows that the returned promise doesn't resolve, and that the secondawait c
doesn't resolve.Reproduction Link
https://codesandbox.io/p/sandbox/serene-paper-v9n5qy?file=%2Fsrc%2FApp.tsx
Beta Was this translation helpful? Give feedback.
All reactions