diff --git a/src/dataset.rs b/src/dataset.rs index 3abf1a40..9e55e8fb 100644 --- a/src/dataset.rs +++ b/src/dataset.rs @@ -70,6 +70,7 @@ impl ChangeSet { // from new_arrays let was_new = self.new_arrays.remove(&path).is_some(); self.updated_arrays.remove(&path); + self.updated_attributes.remove(&path); self.set_chunks.remove(&path); if !was_new { self.deleted_arrays.insert(path, node_id); @@ -937,6 +938,11 @@ mod tests { let chunk = ds.get_chunk_ref(&array1_path, &ArrayIndices(vec![0, 0, 0])).await; assert_eq!(chunk, Some(ChunkPayload::Inline("bac".into()))); + let path: Path = "/group/array2".into(); + assert!(ds.change_set.updated_attributes.contains_key(&path)); + assert!(ds.delete_array(path.clone()).await.is_ok()); + assert!(!ds.change_set.updated_attributes.contains_key(&path)); + Ok(()) } diff --git a/src/lib.rs b/src/lib.rs index 7f1e7286..89893f2b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -778,6 +778,8 @@ pub struct ChangeSet { new_groups: HashMap, new_arrays: HashMap, updated_arrays: HashMap, + // These paths may point to Arrays or Groups, + // since both Groups and Arrays support UserAttributes updated_attributes: HashMap>, // FIXME: issue with too many inline chunks kept in mem set_chunks: HashMap>>,