fix: each block breaking with effects interspersed among items#17550
fix: each block breaking with effects interspersed among items#17550Rich-Harris merged 6 commits intosveltejs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 3a73842 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 |
|
|
Hmm I changed the example to use $effect.pre instead of create subscriber. It not only fails against main, but also causes the tests following it to fail as well. Does that suggest the |
|
err.... hmm. certainly sounds that way. hypothesis (with no evidence): the linked list is somehow getting broken, such that destroying the each block doesn't cause all the child effects to be destroyed |
|
Oh that happens with either effect.pre or createsubscriber... Maybe something like #17541 is needed for both? |
|
I think you're right, but on second thought, it's likely not a real concern after this pr. I think I was seeing it break other tests because the crash happens midway through reconciliation which messes with the linked list globally. Then because tests run in the same process, they would start off with a corrupt effect tree and break again, etc. I was worried skipping non branch effects within each's process would mess with them getting cleaned up but that's taken care of further upstream in effect handling. |
fixes #17433
Alternative to #17541. The single advance at the start of the loop in #17541 (comment) fixes the sample in that pr, but effects could be interspersed elsewhere among the block's items. Since
currentgets advanced several more times further down, it can still result in a freeze with a sample like the one I've added 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