Skip to content

fix: abort and reschedule $effect.pre when necessary #16335

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

Merged
merged 6 commits into from
Jul 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import { flushSync } from 'svelte';
import { test } from '../../test';

export default test({
skip: true,
// For this to work in non-async mode, we would need to abort
// inside `#traverse_effect_tree`, which would be very
// complicated and annoying. Since this hasn't been
// a real issue (AFAICT), we ignore it
skip_no_async: true,

async test({ assert, target, logs }) {
async test({ target }) {
const [open, close] = target.querySelectorAll('button');

flushSync(() => open.click());
flushSync(() => close.click());

assert.deepEqual(logs, [true]);
// if the effect queue isn't aborted after the state change, this will throw
flushSync(() => close.click());
}
});
Loading