diff --git a/lib/actions/upload-actions.js b/lib/actions/upload-actions.js --- a/lib/actions/upload-actions.js +++ b/lib/actions/upload-actions.js @@ -92,7 +92,7 @@ export type DeleteUploadInput = { +id: string, - +threadID: string, + +keyserverOrThreadID: string, }; const updateMultimediaMessageMediaActionType = @@ -103,8 +103,8 @@ callKeyserverEndpoint: CallKeyserverEndpoint, ): ((input: DeleteUploadInput) => Promise) => async input => { - const { id, threadID } = input; - const keyserverID = extractKeyserverIDFromID(threadID); + const { id, keyserverOrThreadID } = input; + const keyserverID = extractKeyserverIDFromID(keyserverOrThreadID); const requests = { [keyserverID]: { id } }; await callKeyserverEndpoint('delete_upload', requests); }; @@ -133,14 +133,14 @@ export type BlobServiceUploadAction = (input: { +uploadInput: BlobServiceUploadInput, - +threadID: string, + +keyserverOrThreadID: string, +callbacks?: MultimediaUploadCallbacks, }) => Promise<{ ...UploadMultimediaResult, blobHolder: ?string }>; const blobServiceUpload = (callKeyserverEndpoint: CallKeyserverEndpoint): BlobServiceUploadAction => async input => { - const { uploadInput, callbacks, threadID } = input; + const { uploadInput, callbacks, keyserverOrThreadID } = input; const { encryptionKey, loop, dimensions, thumbHash, blobInput } = uploadInput; const blobHolder = uuid.v4(); @@ -202,7 +202,7 @@ } // 3. Upload metadata to keyserver - const keyserverID = extractKeyserverIDFromID(threadID); + const keyserverID = extractKeyserverIDFromID(keyserverOrThreadID); const requests = { [keyserverID]: { blobHash, diff --git a/lib/utils/action-utils.test.js b/lib/utils/action-utils.test.js --- a/lib/utils/action-utils.test.js +++ b/lib/utils/action-utils.test.js @@ -12,6 +12,11 @@ const id = keyserverID + '|1234'; expect(extractKeyserverIDFromID(id)).toBe(keyserverID); }); + + it('should return for ', () => { + const keyserverID = '404'; + expect(extractKeyserverIDFromID(keyserverID)).toBe(keyserverID); + }); }); describe('sortCalendarQueryPerKeyserver', () => { diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js --- a/native/input/input-state-container.react.js +++ b/native/input/input-state-container.react.js @@ -837,7 +837,7 @@ ? processedMedia.thumbHash : null, }, - threadID: threadInfo.id, + keyserverOrThreadID: threadInfo.id, callbacks: { blobServiceUploadHandler, onProgress: (percent: number) => { @@ -868,7 +868,7 @@ dimensions: processedMedia.dimensions, thumbHash: processedMedia.thumbHash, }, - threadID: threadInfo.id, + keyserverOrThreadID: threadInfo.id, callbacks: { blobServiceUploadHandler, }, diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js --- a/web/input/input-state-container.react.js +++ b/web/input/input-state-container.react.js @@ -884,7 +884,7 @@ loop: false, thumbHash, }, - threadID, + keyserverOrThreadID: threadID, callbacks, }); } else { @@ -1162,7 +1162,10 @@ abortRequest = pendingUpload.abort; } if (pendingUpload.serverID) { - this.props.deleteUpload({ id: pendingUpload.serverID, threadID }); + this.props.deleteUpload({ + id: pendingUpload.serverID, + keyserverOrThreadID: threadID, + }); if (isBlobServiceURI(pendingUpload.uri)) { invariant( pendingUpload.blobHolder,