Fix mount reconcile drift and local-dir footguns#174
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR addresses three functional issues from ChangesMount re-home safety and LocalDir defaults
Full reconcile and quiet-cycle periodic pulls
Tree command path argument disambiguation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Relayfile Eval ReviewRun: Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0 Human Review CasesNo reviewable human-review cases captured Relayfile output. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/relayfile-cli/main.go`:
- Around line 3754-3765: The code only looks up a workspace via
workspaceRecordByID(workspaceID) and so misses legacy records that have an empty
ID but the Name equals the workspace identifier; update the lookup logic so that
if workspaceRecordByID returns no record you also fall back to locating a legacy
record by name (e.g. call workspaceRecordByName(workspaceID) or scan stored
records for record.ID=="" && record.Name==workspaceID) and assign
recordedLocalDir from that record before using it to populate localDir; keep the
existing recordedLocalDir, workspaceRecordByID, and localDir variables unchanged
and only add the extra fallback branch to preserve recorded LocalDir for legacy
entries.
- Around line 3784-3795: The code currently removes a PID file whenever
verifyDaemonProcess returns verified==false, which wrongly treats “unproven
ownership” as a stale daemon; instead, change the rehome flow to refuse to
proceed (return an error) when pid != 0 && verified == false so we do not delete
mountPIDFile(recordedLocalDir) or orphan a potentially still-running daemon;
locate the block using verifyDaemonProcess(...) and mountPIDFile(...) and
replace the removal branch with a clear error return (or require an explicit
force flag) that instructs the user to stop the existing daemon or run with an
explicit override.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bc92712b-f40d-4a11-b626-db5fe9e54b8b
📒 Files selected for processing (5)
cmd/relayfile-cli/main.gocmd/relayfile-cli/main_test.gointernal/mountsync/bootstrap_test.gointernal/mountsync/syncer.gointernal/mountsync/syncer_test.go
main.go: _⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_ **Preserve recorded `LocalDir` for legac main.go: _⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_ **Don't treat every unverified pid file Co-Authored-By: My Senior Dev <dev@myseniordev.com>
Summary
Fixes #173
Verification