Skip to content

Conversation

dummdidumm
Copy link
Member

Test for #16912

Also some explanation what the bug was:

  1. async batch kicks off
  2. outer async work succeeds, still something pending, so doesn't do anything for now
  3. something unrelated writes to a signal (in the remote functions case it's the query writing to loading, raw etc), which creates a new batch
  4. new batch executes. since there are multiple batches it takes the previous value which means if block is still alive. commits that, since no async work from the perspective of this branch
  5. inner async work succeeds. now the batch has zero pending async work so it can flush. But the if block is no longer dirty since it was done by the other batch already -> never undos the other work

#16912 fixes it by still traversing the tree which means the if block deletion is scheduled to commit later, which it then does

Test for #16912

Also some explanation what the bug was:
1. async batch kicks off
2. outer async work succeeds, still something pending, so doesn't do anything for now
3. something unrelated writes to a signal (in the remote functions case it's the query writing to loading, raw etc), which creates a new batch
4. new batch executes. since there are multiple batches it takes the previous value which means if block is still alive. commits that, since no async work from the perspective of this branch
5. inner async work succeeds. now the batch has zero pending async work so it can flush. But the if block is no longer dirty since it was done by the other batch already -> never undos the other work

#16912 fixes it by still traversing the tree which means the if block deletion is scheduled to commit later, which it then does
Copy link

changeset-bot bot commented Oct 8, 2025

⚠️ No Changeset found

Latest commit: b3d175d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Oct 8, 2025

Playground

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

@dummdidumm dummdidumm merged commit 9c350cf into main Oct 8, 2025
18 checks passed
@dummdidumm dummdidumm deleted the test-for-async-bugfix branch October 8, 2025 12:59
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