Skip to content

Commit

Permalink
Filter out attributes that have names that start with RBX_
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekkonot committed Aug 29, 2024
1 parent 65e02e7 commit b0fe238
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/snapshot_middleware/json_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ fn json_model_from_pair<'sync>(
match value {
Variant::Attributes(attrs) => {
for (attr_name, attr_value) in attrs.iter() {
// We (probably) don't want to preserve internal attributes,
// only user defined ones.
if attr_name.starts_with("RBX_") {
continue;
}
attributes.insert(
attr_name.clone(),
UnresolvedValue::from_variant_unambiguous(attr_value.clone()),
Expand Down
10 changes: 10 additions & 0 deletions src/snapshot_middleware/meta_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ impl AdjacentMetadata {
match value {
Variant::Attributes(attrs) => {
for (attr_name, attr_value) in attrs.iter() {
// We (probably) don't want to preserve internal
// attributes, only user defined ones.
if attr_name.starts_with("RBX_") {
continue;
}
attributes.insert(
attr_name.clone(),
UnresolvedValue::from_variant_unambiguous(attr_value.clone()),
Expand Down Expand Up @@ -266,6 +271,11 @@ impl DirectoryMetadata {
match value {
Variant::Attributes(attrs) => {
for (name, value) in attrs.iter() {
// We (probably) don't want to preserve internal
// attributes, only user defined ones.
if name.starts_with("RBX_") {
continue;
}
attributes.insert(
name.to_owned(),
UnresolvedValue::from_variant_unambiguous(value.clone()),
Expand Down
5 changes: 5 additions & 0 deletions src/snapshot_middleware/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ fn project_node_property_syncback<'inst>(
match value {
Variant::Attributes(attrs) => {
for (attr_name, attr_value) in attrs.iter() {
// We (probably) don't want to preserve internal attributes,
// only user defined ones.
if attr_name.starts_with("RBX_") {
continue;
}
attributes.insert(
attr_name.clone(),
UnresolvedValue::from_variant_unambiguous(attr_value.clone()),
Expand Down

0 comments on commit b0fe238

Please sign in to comment.