19d74d00d6
The synchronous pre-timeout in the implementation was a band-aid for a missing flushSync() in the third test. $effect callbacks are scheduled as microtasks and don't run until flushed — the test set source=true before the initial effect had a chance to register the setTimeout, so advanceTimersByTime fired nothing. Proper fix: call flushSync() after $effect.root so the initial effect runs synchronously, then advance fake timers. Removed the duplicate setTimeout branch from useDelayed — one code path, no race. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>