[core] Attribute: Strip ending "/" from invalidation values

By doing so, invalidation values will evaluate to the same UID
independently from whether the attribute's value has been written
with an extra "/" or not.
This commit is contained in:
Candice Bentéjac 2025-01-14 17:33:27 +01:00
parent 8afc9adad3
commit e0b2aafae3

View file

@ -276,8 +276,11 @@ class Attribute(BaseObject):
# To guarantee that each output attribute receives a unique ID, we add the attribute name to it.
return hashValue((self.name, self.node._uid))
else:
# only dependent on the hash of its value without the cache folder
return hashValue(self._invalidationValue)
# Only dependent on the hash of its value without the cache folder.
# "/" at the end of the link is stripped to prevent having different UIDs depending on
# whether the invalidation value finishes with it or not
strippedInvalidationValue = self._invalidationValue.rstrip("/")
return hashValue(strippedInvalidationValue)
if self.isLink:
linkParam = self.getLinkParam(recursive=True)
return linkParam.uid()