Skip to content
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(store): derived atom not updating when its value changes if another atom is read it conditionally #2700

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

yuneco
Copy link
Contributor

@yuneco yuneco commented Aug 8, 2024

Related Bug Reports or Discussions

Fixes #2697

Summary

Seems a regression in store2 introduced in v2.9.0.

Check List

  • pnpm run prettier for formatting code and docs

Copy link

vercel bot commented Aug 8, 2024

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 Aug 12, 2024 0:48am

Copy link

codesandbox-ci bot commented Aug 8, 2024

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.

Copy link

github-actions bot commented Aug 8, 2024

LiveCodes Preview in LiveCodes

Latest commit: 3f75dea
Last updated: Aug 12, 2024 12:47pm (UTC)

Playground Link
React demo https://livecodes.io?x=id/DKE6DFJX8

See documentations for usage instructions.

@dai-shi
Copy link
Member

dai-shi commented Aug 12, 2024

#2697 (reply in thread)

Comment on lines 512 to 514
const prevEpochNumbers: number[] = topsortedAtoms.map(
(a) => getAtomState(a).n,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let me add a commit to refactor something.

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a good fix. Let's ship it.

@dai-shi dai-shi added this to the v2.9.3 milestone Aug 12, 2024
@dai-shi dai-shi merged commit 41158e6 into pmndrs:main Aug 12, 2024
40 checks passed
@yuneco yuneco deleted the fix/bug-2697 branch August 12, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants