Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Minor implementation/documentation issues (misleading await on synchronous unwatch() and undocumented minimum scan interval behavior) should be corrected before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves Quartz’s watch mode reliability on network/mounted filesystems by switching to per-file watching when Chokidar polling is enabled and adding a periodic reconciliation scan to detect added/removed files, while preserving the existing directory watcher on normal filesystems.
Changes:
- Added
pollingEnabledanddiffContentFilesutilities to support polling-mode behavior. - Updated
startWatchingto (optionally) watch existing files directly and periodically reconcile the watched file list. - Documented the polling configuration and added unit tests for the new utilities.
File summaries
| File | Description |
|---|---|
| quartz/util/contentWatcher.ts | Adds helpers for detecting polling mode and diffing known vs current file sets. |
| quartz/util/contentWatcher.test.ts | Adds unit tests for polling parsing and file set reconciliation. |
| quartz/build.ts | Implements per-file watcher targets in polling mode plus periodic discovery/reconciliation. |
| docs/troubleshooting.md | Documents how to enable polling for mounted/network content and tune intervals. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+178
to
+179
| Polling uses more CPU and filesystem I/O than native events. Increase `CHOKIDAR_INTERVAL` when | ||
| watching a large content directory or when immediate updates are not required. |
Comment on lines
+237
to
+240
| for (const fp of deleted) { | ||
| await watcher.unwatch(path.resolve(contentRoot, fp)) | ||
| recordChange(fp, "delete") | ||
| } |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CHOKIDAR_USEPOLLINGis enabledReproduction
Some network filesystems and Docker bind mounts do not reliably forward directory change events.
In an fnOS Docker deployment with WebDAV-synchronized content, polling the content directory did not detect changes, while polling individual files did.
This change only enables per-file watching and file discovery when polling is explicitly requested. The default native watcher remains unchanged.
Testing
npm run checknpm test(166 tests passed)This PR was written entirely using an LLM.