-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
fix(store2): "stuck" derived atoms where some derivations may never resolve #2448
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Preview in LiveCodesLatest commit: cfd7b88
See documentations for usage instructions. |
Is it even fixable? Feel free to try. |
the problem is that async deps are only recognized by store once the derivation settles. imho all deps should be recognized and tracked as soon as they occur. a consistent read would also be nice, e.g.
|
that's kind of by design: collect deps once in sync and once when settled. it's a computational task, and so it might require some tricks to cover more cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nice tests. The "sync" version actually reveals a bug in store2.ts.
Just a failing test case for:
When an async derived atom picks up a dep asynchronously that never resolves, the derivation never settles even when a subsequent update of the dep does resolve.
I added another test case that demonstrates that picking up the dep synchronously does not lead to this issue