-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: prevent reactivity loss during/after fork #17335
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
base: main
Are you sure you want to change the base?
Conversation
fixes sveltejs#17197, fixes sveltejs#17304, fixes sveltejs#17301, fixes sveltejs#17309
🦋 Changeset detectedLatest commit: 4ee4b75 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 |
|
|
I tested this with my repro mentioned in this comment - sveltejs/kit#15059 (comment) |
| // Track branches toggled during fork execution so we can restore | ||
| // their CLEAN flag after flush | ||
| if (current_batch !== null && current_batch.is_fork) { | ||
| (current_batch.toggled_branches ??= new Set()).add(effect); | ||
| } |
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.
I think it makes sense...there's only one thing that it kinda irks me here: we are restoring ALL the branches to CLEAN but wouldn't this lead to over-running?
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.
Hmm I don't think that's a concern because we only do this for branches that had CLEAN before the fork. I'm pretty sure setting CLEAN doesn't necessarily mean branches will run either, it just allows them to be scheduled.
fixes #17197, fixes #17304, fixes #17301, fixes #17309, possibly others
Thanks to @dummdidumm's prior digging into this here
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 testand lint the project withpnpm lint