Skip to content

fix: handle ref type when extracting blob paths from lexicon#6

Open
trezy wants to merge 1 commit intobigmoves:mainfrom
gamesgamesgamesgamesgames:fix/blob-ref-type-handling
Open

fix: handle ref type when extracting blob paths from lexicon#6
trezy wants to merge 1 commit intobigmoves:mainfrom
gamesgamesgamesgamesgames:fix/blob-ref-type-handling

Conversation

@trezy
Copy link
Contributor

@trezy trezy commented Feb 4, 2026

Fixes blob transformation for array items that use "type": "ref" to reference other definitions (like #mediaItem).

Previously, blobs inside referenced definitions weren't detected, so they weren't transformed to the proper AT Protocol format ($type: "blob", ref: { $link: "cid" }). This caused blobs to appear to upload successfully but fail to retrieve from the PDS.

@trezy trezy force-pushed the fix/blob-ref-type-handling branch from 5c98896 to 1ae25a7 Compare February 4, 2026 01:02
When array items have `"type": "ref"` pointing to another definition
(like `#mediaItem`), the blob path extraction was not following the
reference to find blob fields inside the referenced definition.

This caused blob inputs to not be transformed to the proper AT Protocol
format (`$type: "blob"`, `ref: { $link: "cid" }`), resulting in blobs
that couldn't be retrieved from the PDS.

The fix adds:
- `resolve_ref_properties` function to resolve both local refs (#defName)
  and external refs (nsid#defName) to their property definitions
- Handling for "ref" type in array items in `extract_blob_paths_from_properties`
- Passing lexicon context through the recursive extraction
@trezy trezy force-pushed the fix/blob-ref-type-handling branch from 1ae25a7 to 87779c4 Compare February 4, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant