Skip to content

Commit

Permalink
[core] Attribute: Strip ending "/" from invalidation values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cbentejac committed Jan 14, 2025
1 parent 6c995eb commit c332237
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions meshroom/core/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@ def uid(self):
# 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()
Expand Down

0 comments on commit c332237

Please sign in to comment.