Skip to content

An unreadable resolve answer is not a confirmed miss - #61

Merged
antirotor merged 1 commit into
developfrom
fix/asset-ident-confirmed-miss
Nov 4, 2026
Merged

antirotor merged 1 commit into
developfrom
fix/asset-ident-confirmed-miss

Conversation

@antirotor

@antirotor antirotor commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Description

AyonApi::getAssetIdent returned (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:

Resolve entry Result
entities has a filePath (uri, path)
entities is empty, with or without error (uri, "")
The last entity has no filePath, or it is null (the URI names no representation) (uri, "")
uri or entities missing, entities not a list, entity not an object, filePath not a string empty pair

The shapes for "no path" come from the AYON server's /api/resolve code and live responses.

Linked issues/branches

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Additional info

For other callers: a caller that used .first of a malformed entry now gets an empty string. batchResolvePath and batchResolvePathSerial can 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/resolve with each malformed shape:

  1. Single and batched lookups write no miss marker for any of the four malformed shapes. Without this change, all 16 cases (each shape, each lookup path, memcached and Dragonfly) wrote one.
  2. An answer with empty entities still writes a marker.
  3. The whole resolver scenario suite passes on the merged stack: 123 passed, 2 expected failures for a separate open case.

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@antirotor
antirotor merged commit 296d01e into develop Nov 4, 2026
2 of 4 checks passed
@antirotor
antirotor deleted the fix/asset-ident-confirmed-miss branch November 4, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants