Repository navigation
An unreadable resolve answer is not a confirmed miss - #61
Merged
Merged
Conversation
getAssetIdent returned (uri, "") both when the server answered that it has no path and when an entry could not be read, because the uri was set before the parsing threw. Callers that cache misses could not tell the two apart. An unreadable entry now returns an empty pair, the same as a transport failure.
antirotor
requested review from
tadeas-hejnic
and
a balanced review from Copilot
and removed request for
Copilot
November 4, 2026 16:08
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the changes distinguishing unreadable resolve responses from confirmed no-path results.
No open issues 🎉
What changed in this PR
This PR distinguishes unreadable resolve responses from confirmed “no path” results in AyonApi::getAssetIdent, preventing callers from caching malformed responses as misses.
Changes:
- Return an empty pair for unreadable entries instead of retaining a partially parsed URI.
- Preserve
(uri, "")for valid no-path responses and(uri, path)for resolved paths. - Document the distinct return values in the public API.
| File | Description |
|---|---|
src/AyonCppApi/AyonCppApi.h |
Documents resolved, no-path, and unreadable response results. |
src/AyonCppApi/AyonCppApi.cpp |
Validates response shapes and avoids returning partial results after parsing failures. |
Review effort: Balanced
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
AyonApi::getAssetIdentreturned(uri, "")both when the server answered that it has no path and when a response entry could not be read, because the URI was set before the parsing threw. A caller that caches misses cannot tell these apart, so a malformed answer can be cached as "not found".Changelog
An entry that cannot be read now returns an empty pair, the same as a transport failure. Results are otherwise unchanged:
entitieshas afilePath(uri, path)entitiesis empty, with or withouterror(uri, "")filePath, or it is null (the URI names no representation)(uri, "")uriorentitiesmissing,entitiesnot a list, entity not an object,filePathnot a stringThe shapes for "no path" come from the AYON server's
/api/resolvecode and live responses.Linked issues/branches
(uri, ""). Found in Copilot's review of memcached: batch prewarm reads with memcached_mget ayon-usd-resolver#105.Type of Change
Additional info
For other callers: a caller that used
.firstof a malformed entry now gets an empty string.batchResolvePathandbatchResolvePathSerialcan return an entry with an empty key for such a response, as they already did for an empty entry.Testing
Tested through the resolver's integration harness (ynput/ayon-usd-resolver#107) against a live AYON server, with the tap answering
/api/resolvewith each malformed shape:entitiesstill writes a marker.This repository's own tests were not run. A merge that keeps this commit reachable lets the resolver PR point at it as is; after a squash merge, its submodule pointer needs updating.