swap indexd for syfon#11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bba51b0761
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| access_id = access_method.get("access_id") or access_method.get("type") | ||
| if not access_id: |
There was a problem hiding this comment.
Handle access_url-only methods without forging access_id
This path treats type as a fallback access_id and then calls /objects/{id}/access/{access_id}; for valid DRS objects that provide a direct access_url but no access_id, that call will fail (typically 404) even though a usable URL already exists in the object. This turns otherwise retrievable files into hard failures, so the code should use the existing access_url when present instead of fabricating an access_id from type.
Useful? React with 👍 / 👎.
| source_access_url = access_methods[0].get("access_url") or {} | ||
| source_url = source_access_url.get("url") | ||
| if not source_url: | ||
| raise HTTPException(status_code=500, detail=f"Could not find source URL within {source_record}") |
There was a problem hiding this comment.
Select a usable access method instead of hard-coding index 0
The redirect builder assumes access_methods[0] contains an access_url for the source OME-TIFF and returns 500 if it does not; with multi-method DRS objects, the first entry is not guaranteed to be the one with the needed URL, so valid objects can fail purely due to method ordering. Iterating methods to find a matching source URL (or deriving from signed access response) avoids these false failures.
Useful? React with 👍 / 👎.
No description provided.