feat: sources pull#795
Conversation
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fcf3d6a. Configure here.
| await fs.copy(backupDirPath, typeDir.abspath); | ||
| } else { | ||
| await fs.remove(typeDir.abspath); | ||
| } |
There was a problem hiding this comment.
Catch block may destroy unmodified directory on backup failure
Low Severity
The catch block unconditionally empties the original directory when typeDir.exists is true, regardless of whether the backup was successfully created. If fs.copy(typeDir.abspath, backupDirPath) on line 64 fails (e.g., disk full or permission error on the temp directory), the original directory has not been modified yet (prune hasn't run), but the catch handler still calls fs.emptyDir followed by fs.copy from an incomplete or missing backup — resulting in potential data loss.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fcf3d6a. Configure here.


Description
** Describe what, why and how of the changes clearly and concisely. Add any additional useful context or info, as necessary. **
Todos
** List any todo items necessary before merging, if any. Delete if none. **
Tasks
** Link to task(s) or issue(s) which this PR corresponds to. Example: KNO-54 **
Screenshots
** Attach any screenshots or recordings to visually illustrate the changes, as necessary. Delete if not relevant. **