Fix NamespaceSet.pop() removes item from all backends#514
Conversation
pop() only removed item from first backend via popitem(), leaving stale entries in remaining backends and causing false AASConstraintViolation on subsequent add() for same semantic_id. Fixes eclipse-basyx#496
|
Wait, this is nonsensical though, isn't it? Namespaces only ever identify via one attribute? I think here the class may have been misunderstood, which might mean, we did not implement them cleanly enough, but this is not a bug, as far as I can see. |
|
Thanks for the review, @s-heppner! You're right that current production code uses only one attribute per A |
Summary
NamespaceSet.pop()usedpopitem()on the first backend only, leaving stale entries in all remaining backends. Any subsequentadd()of an item with the samesemantic_idraised a falseAASConstraintViolation.Fix iterates all backends and removes the popped item's key from each.
Fixes #496
Test plan
test_namespaceset_pop_removes_from_all_backends— verifies pop then re-add with same semantic_id succeedstest.model.test_basesuite passes (53 tests)