From 9ccbfca4792eb3f2cace849059bc3ec01358f31f Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 23 May 2026 15:17:05 -0400 Subject: [PATCH] fix(cli): use PDS-returned blob mimeType after upload Local mimeType from filename extension can disagree with the stored blob when PDS dedupes (same CID, original mimeType wins). Record then references the blob with wrong mimeType and PDS rejects publish. Trust uploadBlob response for mimeType and size. --- packages/cli/src/lib/atproto.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/lib/atproto.ts b/packages/cli/src/lib/atproto.ts index bb7476d..db3d973 100644 --- a/packages/cli/src/lib/atproto.ts +++ b/packages/cli/src/lib/atproto.ts @@ -174,13 +174,14 @@ export async function uploadImage( }, ); + const blob = response.data.blob; return { $type: "blob", ref: { - $link: response.data.blob.ref.toString(), + $link: blob.ref.toString(), }, - mimeType, - size: imageBuffer.byteLength, + mimeType: blob.mimeType, + size: blob.size, }; } catch (error) { console.error(`Error uploading image ${imagePath}:`, error); -- 2.51.2