fix(server): normalize file tree paths to POSIX separators#691
fix(server): normalize file tree paths to POSIX separators#691unhappychoice merged 1 commit intomainfrom
Conversation
Backend used OS-native separators when building the file tree, so on Windows leaf labels showed the full path (`internal\Benchmark\plan.md`) because the frontend splits on `/`. Also fixes git status lookup which compared OS-native paths against git's POSIX-format paths. Closes #677 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for mdts-unhappychoice ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #691 +/- ##
=======================================
Coverage 99.34% 99.34%
=======================================
Files 69 69
Lines 1534 1537 +3
Branches 361 371 +10
=======================================
+ Hits 1524 1527 +3
Misses 9 9
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
internal\Benchmark\plan.md) instead of just the filename, because the backend emitted OS-native separators while the frontend split on/.pathvalues returned from/api/filetreeto POSIX (/) form via atoPosixPathhelper. Backend consumers (/api/markdown,/api/outline,/api/diff) all go throughpath.join(directory, filePath)or git CLI, both of which accept POSIX paths on Windows.getGitStatus, which compared OS-nativeentryPathagainst git's POSIX-formatf.pathand would never match on Windows.Closes #677
Test plan
npx jest test/unit/server/routes/filetree.test.ts— all 6 tests pass, including new regression test that simulatespath.sep = '\\'and verifies returned paths contain no backslashes.🤖 Generated with Claude Code