Fix: Windows FileFinder triggers OneDrive sync for cloud-only files#9
Draft
orc-review[bot] wants to merge 2 commits into
Draft
Fix: Windows FileFinder triggers OneDrive sync for cloud-only files#9orc-review[bot] wants to merge 2 commits into
orc-review[bot] wants to merge 2 commits into
Conversation
Owner
|
/review |
Author
|
Orc review failed. |
Owner
|
/review |
Author
|
Orc review failed. |
Owner
|
/review |
| const resolvedTarget = resolve(targetPath); | ||
| const rel = relative(resolvedBase, resolvedTarget); | ||
| // If the relative path starts with "..", the target is outside the base path | ||
| return rel.startsWith(".."); |
Author
There was a problem hiding this comment.
This only treats .. relatives as outside, but on Windows path.relative() returns an absolute path when basePath and targetPath are on different drives (for example C:\repo to D:\data returns D:\data). In that case this returns false, so grep scopes on another drive are treated as inside the FFF base path and the built-in grep fallback won't run. Include an absolute-relative check (and preferably rel === ".." || rel.startsWith(..${sep})) so cross-drive targets are marked outside.
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.
Draft PR created from a Slack delegated code-work request.
Slack request
Fix issue #6: Windows: home-dir FileFinder scan triggers OneDrive sync, downloads cloud-only files.
First, get the full details of this issue by running: gh issue view 6 --repo ShpetimA/pi-fff
Then analyze the codebase to understand:
Implement a fix that prevents FileFinder from triggering OneDrive to download cloud-only files when scanning the home directory. Create a draft pull request with the fix.
Context
Workspace: T0BDHMJQZRR
Channel: C0BDQ287KBL
Thread: 1783097695.578009
Repository source: tool_input
Worktree: .orc/worktrees/slack/github/ShpetimA__pi-fff/T0BDHMJQZRR/C0BDQ287KBL/1783097695.578009/worktree
Agent result
Perfect! Everything passes. Let me create a brief summary of what was done:
Summary
I have successfully implemented a fix for Issue #6: Windows: home-dir FileFinder scan triggers OneDrive sync, downloads cloud-only files.
Changes Made
Added home directory detection (
src/fff-runtime.ts):isHomeDirectory()helper function to check if a path is the user's home directoryinitialize()method to prevent FileFinder from scanning the home directoryAdded test coverage (
tests/fff-runtime.test.ts):initialize rejects home directory as project rootverifies the fix works correctlyHow It Works
When pi-fff initializes:
.gitdirectory).gitis found, it falls back to the current working directoryBenefits
Validation
The fix is ready to be committed and pushed. The changes are in the worktree and will be committed, pushed, and a draft PR will be opened by Orc.