diff --git a/experimental/PropertyDDS/packages/property-properties/src/properties/indexedCollectionBaseProperty.js b/experimental/PropertyDDS/packages/property-properties/src/properties/indexedCollectionBaseProperty.js index 2cd494b839b7..e30853b30e82 100644 --- a/experimental/PropertyDDS/packages/property-properties/src/properties/indexedCollectionBaseProperty.js +++ b/experimental/PropertyDDS/packages/property-properties/src/properties/indexedCollectionBaseProperty.js @@ -233,7 +233,7 @@ export class IndexedCollectionBaseProperty extends AbstractStaticCollectionPrope this._setDirty(in_reportToView); } else { - throw new Error(MSG.REMOVED_NON_EXISTING_ENTRY + in_key); + console.warn(MSG.REMOVED_NON_EXISTING_ENTRY + in_key); } } diff --git a/experimental/PropertyDDS/packages/property-properties/src/properties/mapProperty.js b/experimental/PropertyDDS/packages/property-properties/src/properties/mapProperty.js index 9ea6def78721..606a2c6cbe08 100644 --- a/experimental/PropertyDDS/packages/property-properties/src/properties/mapProperty.js +++ b/experimental/PropertyDDS/packages/property-properties/src/properties/mapProperty.js @@ -271,9 +271,11 @@ export class MapProperty extends IndexedCollectionBaseProperty { /** * Removes the entry with the given key from the map * + * Note: If the key does not exist, a warning is logged and no error is thrown. + * This is intentional to support idempotent operations in collaborative editing scenarios. + * * @param {string} in_key - The key of the entry to remove from the map - * @throws If trying to remove an entry that does not exist - * @return {*} the item removed + * @return {*} the item removed, or undefined if the key does not exist */ remove(in_key) { var item = this.get(in_key); diff --git a/experimental/PropertyDDS/packages/property-properties/src/properties/referenceMapProperty.js b/experimental/PropertyDDS/packages/property-properties/src/properties/referenceMapProperty.js index d3474204919a..48d2990123da 100644 --- a/experimental/PropertyDDS/packages/property-properties/src/properties/referenceMapProperty.js +++ b/experimental/PropertyDDS/packages/property-properties/src/properties/referenceMapProperty.js @@ -82,9 +82,11 @@ export class ReferenceMapProperty extends StringMapProperty { /** * Removes the entry with the given key from the map * + * Note: If the key does not exist, a warning is logged and no error is thrown. + * This is intentional to support idempotent operations in collaborative editing scenarios. + * * @param {string} in_key - The key of the entry to remove from the map - * @throws If trying to remove an entry that does not exist - * @returns {String} the item removed (a string pathT + * @returns {String} the item removed (a string path), or undefined if the key does not exist */ remove(in_key) { var item = this.getValue(in_key); diff --git a/experimental/PropertyDDS/packages/property-properties/src/properties/setProperty.js b/experimental/PropertyDDS/packages/property-properties/src/properties/setProperty.js index 69d2cee64282..23160d3ed4c0 100644 --- a/experimental/PropertyDDS/packages/property-properties/src/properties/setProperty.js +++ b/experimental/PropertyDDS/packages/property-properties/src/properties/setProperty.js @@ -171,9 +171,11 @@ export class SetProperty extends IndexedCollectionBaseProperty { /** * Removes the given property from the set * + * Note: If the entry does not exist, a warning is logged and no error is thrown. + * This is intentional to support idempotent operations in collaborative editing scenarios. + * * @param {property-properties.NamedProperty|string} in_entry - The property or its URN to remove from the set - * @return {property-properties.NamedProperty} the property that was removed. - * @throws if trying to remove an entry that does not exist + * @return {property-properties.NamedProperty} the property that was removed, or undefined if not found */ remove(in_entry) { if (_.isString(in_entry)) {