Skip to content
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

Feature: Add support for watching folders in file navigator #646

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

nanashili
Copy link
Member

Summary

This PR enhances the file system interactions, subprocess handling, and introduces a file watcher for real-time file change detection in our project. The focus is on improving performance, error management, robustness of the file operations, process management, and timely updates to file changes.

Changes Made

  • Optimized the loadFiles function to handle directory enumeration more efficiently using POSIX APIs.
  • Fixed the improper handling of file descriptors in subprocess execution, ensuring all file descriptors are valid before use in posix_spawn.
  • Enhanced error handling and logging in file system operations and process creation to provide better debugging and error traceability.
  • Modified recursive file loading to better manage memory and ensure thread safety.
  • Implemented a file watcher mechanism to monitor changes in the file system and update the application state in real-time.

TODO

  • Review the handling of maximum filename lengths and ensure proper null termination in file operations.
  • Implement further optimizations based on profiling results.
  • Additional unit tests covering edge cases for both file system operations, subprocess handling, and file watcher functionality.
  • Integration testing to confirm that the file watcher interacts correctly with other system components.

Motivation

The primary goal of this PR is to address performance bottlenecks, error management issues, and the lack of real-time file change detection in our handling of file system operations and subprocesses. These changes are necessary to improve the reliability and efficiency of our application, particularly in handling large directories, robust process management, and immediate responsiveness to file system changes.

Testing

  • Manual testing was conducted on the loadFiles function to ensure accurate directory traversal and file handling.
  • Regression tests were performed to ensure existing functionality was not adversely affected.
  • The file watcher was tested in various scenarios to ensure it accurately detects and responds to file changes in real-time.
  • The changes were profiled to confirm performance improvements.

Screenshots/GIFs

N/A

Checklist

Please ensure all of the following are completed before submitting the PR:

  • Code has been tested and verified.
  • Documentation has been updated to reflect the changes.
  • All tests pass successfully.
  • Code follows the project's coding guidelines and style.
  • The branch is up-to-date with the latest changes from the main branch.
  • Reviewed by at least one other contributor.

Related Issues

This PR addresses the following issue(s): []

Additional Notes

The changes introduced in this PR involve critical parts of the system; thus, extensive testing and careful review are recommended. We should also monitor the system's behavior in production closely following deployment to catch any unforeseen issues early.

@aurora-care-bear
Copy link
Collaborator

Thanks for submitting a pull request!
We will review it as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants