Skip to content

Conversation

@husjon
Copy link
Contributor

@husjon husjon commented Dec 2, 2025

This makes it so that the events are not fired until the file have stabilized. This also changes the order of the fired events.
A move / rename now results in delete prior to add rather than the other way around.

Could also have set atomic to false but that could potentially break when using other editors like VSCode or similar that uses atomic writes.

From chokidar README - https://github.com/paulmillr/chokidar?tab=readme-ov-file#performance:

  • awaitWriteFinish.stabilityThreshold (default: 2000). Amount of time in milliseconds for a file size to remain constant before emitting its event.

The threshold is intentionally set to a lower value of 250ms, so that we get a decent threshold while retaining snappiness between a save and a rebuild, although could be lowered / raised if needed.

Fixes #2232

… threshold

This makes it so that the events are not fired until the file have stabilized.
This also changes the order of the fired events.
A move / rename now results in `delete` then `add` rather than the other way around.

From `chokidar` README - https://github.com/paulmillr/chokidar?tab=readme-ov-file#performance:
```
awaitWriteFinish.stabilityThreshold (default: 2000). Amount of time in milliseconds for a file size to remain constant before emitting its event.
```

Fixes jackyzha0#2232
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
quartz ✅ Ready (View Log) Visit Preview 1b71f26
@husjon husjon changed the title fix(build.ts/startWatching): add option awaitWriteFinish with 250ms threshold Dec 3, 2025
@husjon husjon changed the title Fix build crash when renaming files Dec 3, 2025
@impfromliga
Copy link

impfromliga commented Dec 8, 2025

@husjon got ahead of me! Found the same, but trying to workaround by retimeouting rebuildlate() with 250ms, keep youre fix. Cause it just config. And it work fine! Thx

// on win11 it bug happened too (Quartz Version: v4.5.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants