-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Describe the bug
I have run into a scenario where async code of any kind seems to not immediately be run/flushed. In other words $effect.pending
will be stuck > 0
and things like async derived
s will not re-run even when the value they depend on changes. They will eventually be run if something else triggers a flush of pending promises.
I am not certain I have found the minimal reproduction, but after many hours I have narrowed it down to swapping out recursive dynamic components.
Reproduction
Reproduction: https://svelte.dev/playground/eee80b71655641e3b7e0eb5afcb93469?version=5.39.5
This reproduction shows a basic tree structure rendered by the Node component. The displayed Message component contains async work.
Click the "Swap children" button which will replace the existing Message with a pair of Messages nested one level deeper.
Observe that the $effect.pending()
displayed is stuck > 0
. Observe that the async derived that doubles the input
number does not re-run after the initial calculation.
Logs
System Info
System:
OS: Linux 6.15 Arch Linux
CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
Memory: 4.58 GB / 15.54 GB
Container: Yes
Shell: 5.3.3 - /bin/bash
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
pnpm: 10.13.1 - ~/.local/share/pnpm/pnpm
Browsers:
Chromium: 139.0.7258.66
Severity
blocking an upgrade