fix(local_file): address review feedback on change_stream() watcher implementation#98
Merged
bashandbone merged 3 commits intoclaude/issue-51-20260310-2131from Mar 16, 2026
Merged
Conversation
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
recoco-docs | a9f44ea | Commit Preview URL Branch Preview URL |
Mar 16 2026, 12:28 AM |
Copilot
AI
changed the title
[WIP] Add filesystem watch support to local_file source
fix(local_file): address review feedback on change_stream() watcher implementation
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the LocalFile source’s change-stream behavior to be more robust when using notify for filesystem watching.
Changes:
- Add explicit logging for
notifywatcher errors. - Skip directory paths emitted by
notifyduring change-stream processing. - Update
Cargo.lockto include/resolvenotifyand its transitive dependencies.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/recoco-core/src/ops/sources/local_file.rs | Improves watcher callback error handling and filters watcher-emitted paths during change streaming. |
| Cargo.lock | Locks new dependency graph entries (notably notify) required for local file watching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
bashandbone
added a commit
that referenced
this pull request
Mar 16, 2026
* feat: add filesystem watch support to local_file source Port upstream feature from cocoindex-io/cocoindex#1669 to enable real-time change detection for the LocalFile source using the notify crate. Changes: - Add notify 8.2.0 dependency to workspace and recoco-core - Wire notify into source-local-file feature - Add optional watch_changes field to Spec (defaults to false) - Add watch_changes field to Executor - Implement change_stream() method using notify::RecommendedWatcher - Add Clone derive to PatternMatcher for use in async stream - Filter filesystem events through existing PatternMatcher The feature is opt-in and fully backward-compatible. When enabled, the source bridges filesystem events via tokio::sync::mpsc into the change_stream() interface for low-latency continuous indexing. Related to #27 Co-authored-by: Adam Poulemanos <bashandbone@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> * fix(local_file): address review feedback on change_stream() watcher implementation (#98) * Initial plan * fix: address review feedback on change_stream() in local_file source Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --------- Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * update lockfile --------- Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Adam Poulemanos <bashandbone@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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.
Three issues in the
change_stream()implementation identified in review: watcher backend errors were silently swallowed, directory-path events could reachget_value()causingEISDIRerrors, andnotify 8.2.0was absent fromCargo.lock.Changes
Error logging: Replaced
if let Ok(event) = reswithmatch res, addingwarn!on theErrbranch so watcher backend failures (permission errors, crashes) are surfaced via tracing.Directory filtering: Added
if !path.is_file() { continue; }guard at the top of the stream loop.notifyemits events for directory paths on create/remove/rename; without this, those paths propagate toget_value()and returnEISDIRrather thanNonExistence.Cargo.lock: Ran
cargo fetchto includenotify 8.2.0and transitive deps in the lockfile.try_sendis intentionally retained — the earlier resolved review thread flagged thatblocking_sendinside a notify callback stalls the watcher backend thread. The 100-entry buffered channel withwarn!-logged drops is the correct trade-off.📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.