3905: Cache objects by local id as well as id #1284
Merged
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.
Link to issue
https://platform.dandigbib.org/issues/3905
https://platform.dandigbib.org/issues/3828
Description
Issue 3828 (#1261) introduced the possibility for requesting OpenSearch objects
by local id (Faust) as well as object id (PID). In parallel the cache
handling was updated with #1271
. The two changes did not take each other into
account.
This resulted in situations for local id requests without object ids
where types were mismanaged causing fatal type errors.
To handle the situation better this change does two things:
well as object id (if defined)
To ensure that the change integrity I have tested that doing a search only results in a single request to OpenSearch and that a repeated search does not result in any request. Thus the gains achieved in #1271 should be intact.
Checklist
Additional comments or questions
This only increases the complexity of our cache. I also considered creating a new object request class in Ting Client based on Local Id instead of Object Id. That might have made the implementation here a bit cleaner. In the end I opted for this approach.