-
Notifications
You must be signed in to change notification settings - Fork 41
feat:exclude error files(3746) #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThis change introduces a new file exclusion capability to the local sync manager. A new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/renderer/actions/local-sync/fs-manager.ts (1)
128-157: Consider simplifying the path normalization logic.The current implementation uses
getNormalizedPath(line 131) which adds a trailing slash designed for directories, then removes it later (lines 155-157). This add-then-remove pattern works but is unnecessarily complex.Consider this simpler approach:
- const normalizedFilePath = getNormalizedPath(filePath); + // Ensure absolute path + const absolutePath = filePath; // Validate that file is within workspace - if (!normalizedFilePath.startsWith(this.rootPath)) { + if (!absolutePath.startsWith(this.rootPath.replace(/\/$/, ''))) { return { type: "error", error: { code: ErrorCode.WrongInput, message: "File path must be within the workspace root", path: filePath, fileType: FileTypeEnum.UNKNOWN, }, }; } // Convert absolute path to relative path - let relativePath = normalizedFilePath.replace(this.rootPath, ""); - - // Remove leading slash if present - if (relativePath.startsWith("/")) { - relativePath = relativePath.substring(1); - } - - // Remove trailing slash if present (files shouldn't have trailing slashes) - if (relativePath.endsWith("/")) { - relativePath = relativePath.substring(0, relativePath.length - 1); - } + let relativePath = absolutePath + .replace(this.rootPath, "") + .replace(/^\/+/, "") // Remove leading slashes + .replace(/\/+$/, ""); // Remove trailing slashesAlternatively, keep the current implementation if directory exclusions with trailing slashes are intentionally supported.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/renderer/actions/local-sync/fs-manager.rpc-service.ts(1 hunks)src/renderer/actions/local-sync/fs-manager.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/renderer/actions/local-sync/fs-manager.ts (5)
src/renderer/actions/local-sync/types.ts (1)
FileSystemResult(45-45)src/renderer/actions/local-sync/common-utils.ts (2)
getNormalizedPath(22-25)appendPath(27-30)src/renderer/actions/local-sync/schemas.ts (1)
Config(5-8)src/renderer/actions/local-sync/constants.ts (1)
CONFIG_FILE(5-5)src/renderer/actions/local-sync/fs-utils.ts (1)
writeContentRaw(314-350)
🔇 Additional comments (4)
src/renderer/actions/local-sync/fs-manager.rpc-service.ts (1)
154-157: LGTM! Method exposure follows established patterns.The IPC exposure of
excludeFileis correctly implemented and consistent with other method exposures in this service.src/renderer/actions/local-sync/fs-manager.ts (3)
160-179: Good defensive programming and idempotency handling.The config validation and duplicate checking ensure the method is safe and idempotent, returning early if the path is already excluded.
182-207: LGTM! Config update and reload logic is correct.The implementation properly updates the config, writes it atomically, and reloads the workspace to apply exclusion changes immediately.
208-219: Error handling follows established patterns.The catch-all error handler appropriately uses
ErrorCode.UNKNOWNand returns a properly structuredFileSystemError.
Closes issue: requestly/requestly#3746
🎥 Demo Video:
Video/Demo:

Before :
After :
Screen.Recording.2025-11-22.at.7.02.49.PM.mov
📜 Summary of changes:
📝 Overview
Implemented a new feature that allows users to exclude errored files directly from
the UI. When a workspace contains invalid/unsupported files, users can now click an
"Exclude" button to permanently ignore these files in future workspace scans.
✨ What's New
User-Facing Features
🏗️ Architecture
The implementation follows the existing architecture pattern and leverages the
already-present exclusion mechanism:
UI (React) → Repository → Adapter → IPC → Desktop App (FsManager) → requestly.json
How It Works
📁 Files Changed
Desktop App (requestly-desktop-app)
Webapp (requestly/app)
ync.ts
List/ErrorFileslist.tsx
Exclusion Mechanism
Filtering Flow
✅ Testing Checklist
🎨 UI Changes
Before: Errored files only had "Edit" and "Delete" buttons
After: Errored files now have "Edit", "Exclude" (eye-off icon), and "Delete"
buttons
📊 Impact
requestly.json
🔗 Related
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.