mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Refactor instance metadata handling to incorporate glob-ignored children
- Renamed `ignore_unknown_instances` to `suppress_removals` in patch computation logic for clarity. - Updated tests to reflect the new naming and behavior, ensuring correct handling of instance removals based on `glob_ignored_children`. - Enhanced API and interface definitions to include `glob_ignored_children`, improving metadata management for instance synchronization.
This commit is contained in:
parent
12bccf91c5
commit
1406c1a1b7
3 changed files with 66 additions and 15 deletions
|
|
@ -4317,6 +4317,7 @@ fn filter_subscribe_message_for_scripts<'a>(
|
|||
for inst in msg.added.values_mut() {
|
||||
inst.metadata = Some(InstanceMetadata {
|
||||
ignore_unknown_instances: true,
|
||||
glob_ignored_children: false,
|
||||
});
|
||||
|
||||
// Non-scripts don't sync properties - they're just tree structure
|
||||
|
|
@ -4384,6 +4385,7 @@ fn instance_for_scripts_only<'a>(
|
|||
// This ensures we only sync script content, never delete/modify other instances
|
||||
let metadata = Some(InstanceMetadata {
|
||||
ignore_unknown_instances: true,
|
||||
glob_ignored_children: false,
|
||||
});
|
||||
|
||||
Instance {
|
||||
|
|
|
|||
|
|
@ -155,12 +155,15 @@ pub struct InstanceUpdate {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct InstanceMetadata {
|
||||
pub ignore_unknown_instances: bool,
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub glob_ignored_children: bool,
|
||||
}
|
||||
|
||||
impl InstanceMetadata {
|
||||
pub(crate) fn from_rojo_metadata(meta: &RojoInstanceMetadata) -> Self {
|
||||
Self {
|
||||
ignore_unknown_instances: meta.ignore_unknown_instances,
|
||||
glob_ignored_children: meta.glob_ignored_children,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue