Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32559099
D9738.1767277921.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D9738.1767277921.diff
View Options
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<void>) =>
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 <keyserverID> for <keyserverID>', () => {
+ 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,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 1, 2:32 PM (20 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5876419
Default Alt Text
D9738.1767277921.diff (3 KB)
Attached To
Mode
D9738: [lib] Accept keyserver ID in blob service upload action
Attached
Detach File
Event Timeline
Log In to Comment