Update snapshot files and enhance VFS event handling

- Updated snapshot files to reflect changes in IDs for consistency across connected mode tests.
- Improved VFS event processing in ChangeProcessor to handle multiple events more efficiently, ensuring consistent message structure across platforms.
- Added merging functionality for patch sets to consolidate changes from various VFS events, enhancing synchronization reliability.

These changes improve the accuracy of test snapshots and optimize VFS event management.
This commit is contained in:
Joe 2026-02-12 02:13:58 -06:00
parent b1789a37be
commit 2e49763b69
8 changed files with 77 additions and 27 deletions

View file

@ -81,6 +81,23 @@ impl AppliedPatchSet {
pub fn is_empty(&self) -> bool {
self.removed.is_empty() && self.added.is_empty() && self.updated.is_empty()
}
/// Merge multiple patch sets into a single consolidated set.
///
/// Different platforms deliver VFS events in different orders for the
/// same filesystem operation (e.g., macOS FSEvents sends CREATE first,
/// Windows ReadDirectoryChangesW sends REMOVE first for renames).
/// Merging ensures the WebSocket message structure is identical
/// regardless of event ordering.
pub fn merge(patches: Vec<AppliedPatchSet>) -> AppliedPatchSet {
let mut merged = AppliedPatchSet::new();
for patch in patches {
merged.removed.extend(patch.removed);
merged.added.extend(patch.added);
merged.updated.extend(patch.updated);
}
merged
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]