-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EdgePropertyList construction via _from_object_info (#562)
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 the `EdgePropertyList`'s control. This led to a bug when constructing objects via `_from_object_info`, which first default-constructs the object (in the process creating the `EdgePropertyList`) 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: - If the current list is already populated (the "regular" case), only a sanity check for matching length is performed - If the current list is empty, it is re-fetched from the parent object. This is the case which occurs during construction with `_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 the `channel` argument was still used instead of `server_wrapper`.
- Loading branch information
Showing
13 changed files
with
320 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.