mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Add .gitignore for logs and skip directory WRITE events on Windows
- Created a new .gitignore file to exclude .txt files in the logs directory. - Updated the `ChangeProcessor` to skip directory-level WRITE events on Windows, preventing stale data issues in the VFS cache and ensuring correct patch generation. These changes enhance the handling of file events and improve the organization of log files.
This commit is contained in:
parent
056d3609f7
commit
3bf5951b75
2 changed files with 22 additions and 0 deletions
|
|
@ -749,6 +749,27 @@ impl JobThreadContext {
|
|||
.commit_event(&event)
|
||||
.expect("Error applying VFS change");
|
||||
|
||||
// On Windows, ReadDirectoryChangesW fires a directory-level WRITE event
|
||||
// when a file inside the directory is modified, in addition to the
|
||||
// file-level WRITE event. The directory event arrives first, but at that
|
||||
// point the VFS cache still has the old file content (only the directory
|
||||
// entry was committed, not the file). Re-snapshotting from the directory
|
||||
// event reads stale data and produces incorrect patches. The file-level
|
||||
// event that follows will correctly invalidate the cache and re-snapshot.
|
||||
// Skip WRITE events for directories on Windows only -- macOS kqueue uses
|
||||
// directory WRITE events meaningfully (e.g., file creation/deletion
|
||||
// notifications) so they must be processed there.
|
||||
#[cfg(target_os = "windows")]
|
||||
if let VfsEvent::Write(ref path) = event {
|
||||
if path.is_dir() {
|
||||
log::info!(
|
||||
"VFS event SKIPPED (directory WRITE, deferring to file events): {}",
|
||||
self.display_path(path)
|
||||
);
|
||||
return Vec::new();
|
||||
}
|
||||
}
|
||||
|
||||
// For a given VFS event, we might have many changes to different parts
|
||||
// of the tree. Calculate and apply all of these changes.
|
||||
let applied_patches = match event {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue