Closed sphuber closed 2 months ago
LGTM. I am wondering, how does this interact with nodes that are stored but not sealed? (such as running Calcjob)
Attributes that can be changed after a node is stored have to be part of _updatable_attributes
in order to not incur the ModificationNotAllowed
exception and these are automatically excluded from the hash calculation. So these should have no impact whatsoever.
The
get_hash
method was actually recomputing the hash and not just returning the hash stored in the extras that was computed when the node got stored. Theget_hash
and_get_hash
methods are renamed tocompute_hash
and_compute_hash
, respectively. This allowsget_hash
to be reimplemented to simply return the hash stored in the extras.Although technically speaking this is changing the implementation of public facing API, if users even use
get_hash()
it will have been to retrieve the hash for an already stored node, which is therefore equal to just returning the pre-computed hash stored in the extras. So effectively this should not be a breaking change.