Skip to content

fix: prevent corrupt batch link state#18296

Closed
dummdidumm wants to merge 1 commit into
mainfrom
batch-link-fix
Closed

fix: prevent corrupt batch link state#18296
dummdidumm wants to merge 1 commit into
mainfrom
batch-link-fix

Conversation

@dummdidumm

Copy link
Copy Markdown
Member

It should be theoretically possible to end up in a state where a batch is unlinked, then relinked (via the if (this.#roots.length > 0) logic at the end of #process), at which point the links would be wrong if we're not nulling out prev/next during unlink.

This adds that, though no test because I wasn't able to come up with one.

It should be theoretically possible to end up in a state where a batch is unlinked, then relinked (via the `if (this.#roots.length > 0)` logic at the end of `#process`), at which point the links would be wrong if we're not nulling out prev/next during unlink.

This adds that, though no test because I wasn't able to come up with one.
@changeset-bot

changeset-bot Bot commented May 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 16511dd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

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

@svelte-docs-bot

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@18296

@Rich-Harris

Copy link
Copy Markdown
Member

Variation of this that deletes some code #18298

@dummdidumm dummdidumm closed this May 27, 2026
@dummdidumm dummdidumm deleted the batch-link-fix branch May 27, 2026 08:20
dummdidumm pushed a commit that referenced this pull request May 27, 2026
alternative to #18296 — no need to make batches relinkable if we only
unlink them when we're fully done with them
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