-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: set deriveds as CLEAN
if they are assigned to
#15592
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 4e281a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
If the derived is unowned then it might not be safe to mark it as clean, but rather maybe dirty. |
Gotcha, will see if it works in a bit...can you help me come up with a test that actually test the problematic situation (the test I wrote is using unowned deriveds no?) |
Oh wait this has a bug |
Mmm this is more complex than i thought: if we reassign before the first read then the derived is not a reaction of the state and it will not be updated when the state changes 🤔 |
…when it's reassigned
@trueadm this fixes the bug i was talking about but it introduce a new constant and basically execute the derived without assigning the value and the status in the case where the derived is clean because it was assigned to (basically it's just to still register the dependency). I couldn't come up with a better idea but i wonder if there's one. |
Closes #15590
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint