Add tests for stale dependents
Related Issues or Discussions
Fixes #2532
Summary
Add missing test case for conditional dependents receiving stale values since 59e04ab.
Check List
- [x]
yarn run prettierfor formatting code and docs
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| jotai | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 21, 2024 1:54pm |
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.
Add missing test case for conditional dependents receiving stale values since 59e04ab.
So, it's a regression in #2363 and v2.6.4.
Preview in LiveCodes
Latest commit: 71942009caa9cb9bd98045b64a710b3779abfec1
Last updated: May 21, 2024 1:53pm (UTC)
| Playground | Link |
|---|---|
| React demo | https://livecodes.io?x=id/9AHXWMS9P |
See documentations for usage instructions.
oops, #2535 wasn't enough...
hmm, is it really failing?
Hi @samkline, if you are around, can you check this and see if you can fix store.ts?
We need to fix this...
I did some investigating and I believe the regression involves force in readAtomState.
- Column 1 is the test results before the regression (off of 2a25f039)
- Column 2 is the test results after the regression (off of 1d7e6e3cf)
- Column 3 is the test results after monkey-patching column 2's
forceto match column 1
My understanding is that force is the cause of this regression. Before the regression, in this test case, readAtomState is called with a force of undefined then true and then undefined but after the regression readAtomState is called with a force of undefined then undefined and then true. As demonstrated in column 3, simply changing force to match the old way seems to fix the regression.
I did some investigating and I believe the regression involves
forceinreadAtomState.
Nice finding.
simply changing
forceto match the old way seems to fix the regression.
I didn't follow everything. So, what's the suggested change?
Sorry, it was a debugging change I made just for the test case (these lines) to learn whether force played a part in the regression. I don't have any code changes for production to fix the bug.