Closed greschd closed 3 weeks ago
@roosre this is a fairly significant bugfix, I'd suggest we do a 0.1b2
release for it (and only drop Python 3.9 support after that).
Attention: Patch coverage is 98.03922%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 92.91%. Comparing base (
eb5056c
) to head (661edaf
). Report is 2 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
...ore/_tree_objects/_grpc_helpers/property_helper.py | 88.88% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Still figuring out some edge cases when the cloned object is accessed before storing.
Fixes #561
The
EdgePropertyList
retains the same list instance during its lifetime for containing the edge property wrappers. This is done so that references user code might hold to its items to correctly update its contents.In contrast to other types, it means that the state is not re-fetched from the
_pb_object
if it were to change outside of theEdgePropertyList
's control. This led to a bug when constructing objects via_from_object_info
, which first default-constructs the object (in the process creating theEdgePropertyList
) and then modifies the_pb_object
.To fix this, the
EdgePropertyList
now stores whether its parent object was stored when this list was last accessed. If it changes from unstored to stored, the following logic is applied:_from_object_info
Since the edge property list can be in an inconsistent state (empty when it shouldn't be) while the parent is unstored, we disallow accessing it in this state. It is still allowed however to fully replace the contents.
This PR also fixes a bug in
tree_object_from_resource_path
, where thechannel
argument was still used instead ofserver_wrapper
.