You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(loader-client,loader-server): the watchers throttle on the first event instead of debouncing #136
A build that writes its files over more than 100 ms triggers a reload or restart in the middle of the build: the page can fetch the manifest of a half-written build, and the changes inside the window are dropped.
The client's two watchers (client dir and --watch-server-dir) share one lastCall, so a server change less than 100 ms after a client change is lost.
The docs describe a debounce ("Changes closer than 100 ms count as one", client.mdx#L51, server.mdx#L33), not this behavior.
Found by reading the code path (not reproduced).
Expected: one reload or restart after the last change of a burst.
Suggested fix: a trailing debounce (reset a setTimeout on each event), one timer per watched folder.
Found during a read-only audit of main @ 044c766 (2026-11-11).
Code sample
letlastCall=Date.now();constonClientWatch=()=>{if(lastCall+100>Date.now())return;// drops the rest of the burstlastCall=Date.now();server.publish("watch","update");// fires on the first event};
Activity