Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): Send composer images in upload wire format #4035

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/4035/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 46 additions and 3 deletions (loading 1).

x
0 of 4 viewed, 4 left
31 additions and 1 deletionapps/mobile/src/lib/composerImages.test.tsModified
View file
@@ -36,7 +36,37 @@
uuidv4: () => "attachment-id",
}));
​
-import { convertPastedImagesToAttachments, isOwnedPastedImageUri } from "./composerImages";
+import {
+ convertPastedImagesToAttachments,
+ isOwnedPastedImageUri,
+ toUploadChatImageAttachments,
+} from "./composerImages";
+​
+describe("toUploadChatImageAttachments", () => {
+ it("strips client draft id and previewUri for the startTurn wire shape", () => {
+ expect(
+ toUploadChatImageAttachments([
+ {
+ id: "client-draft-id",
+ type: "image",
+ name: "pasted-image.png",
+ mimeType: "image/png",
+ sizeBytes: 12,
+ dataUrl: "data:image/png;base64,AA==",
+ previewUri: "file:///tmp/preview.png",
+ },
+ ]),
+ ).toEqual([
+ {
+ type: "image",
+ name: "pasted-image.png",
+ mimeType: "image/png",