mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
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:
parent
b1789a37be
commit
2e49763b69
8 changed files with 77 additions and 27 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue