Fix issue that can cause infinite recursion during full resolve #204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The collection set_self_href has specific logic that will remove and add data to the root catalog's resolved object cache. This is required so that the collection cache, which is used when merging common properties into items (a pre-1.0 STAC feature), can keep proper track of the collection that are cached by href. However, if the root link is not yet resolved, this cache swapping does not need to occur. In a situation where the root was itself a collection there was an infinite loop between resolving the root link and setting it's self href, which in turn caused the not-quite-yet-resolved root link to go through the logic again.
This fix will only swap cache instances out for collections during set_self_href for root links that have already been resolved.
It adds a version of the planet disaster data locally as test case 8, which exhibits this bug without this fix.