Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3345483
D13410.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13410.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
@@ -174,7 +174,7 @@
const { uploadInput, callbacks, keyserverOrThreadID } = input;
const { encryptionKey, loop, dimensions, thumbHash, blobInput } =
uploadInput;
- const blobHolder = await generateBlobHolder();
+ const blobHolder = generateBlobHolder(authMetadata.deviceID);
const blobHash = toBase64URL(uploadInput.blobHash);
const defaultHeaders = createDefaultHTTPRequestHeaders(authMetadata);
diff --git a/lib/utils/blob-service.js b/lib/utils/blob-service.js
--- a/lib/utils/blob-service.js
+++ b/lib/utils/blob-service.js
@@ -4,7 +4,6 @@
import uuid from 'uuid';
import { toBase64URL } from './base64.js';
-import { getContentSigningKey } from './crypto-utils.js';
import { replacePathParams, type URLPathParams } from './url-utils.js';
import type { BlobServiceHTTPEndpoint } from '../facts/blob-service.js';
import blobServiceConfig from '../facts/blob-service.js';
@@ -54,17 +53,15 @@
}
/**
- * Generates random blob holder prefixed by current device ID
+ * Generates random blob holder prefixed by current device ID if present
*/
-async function generateBlobHolder(): Promise<string> {
+function generateBlobHolder(deviceID?: ?string): string {
const randomID = uuid.v4();
- try {
- const deviceID = await getContentSigningKey();
- const urlSafeDeviceID = toBase64URL(deviceID);
- return `${urlSafeDeviceID}:${randomID}`;
- } catch {
+ if (!deviceID) {
return randomID;
}
+ const urlSafeDeviceID = toBase64URL(deviceID);
+ return `${urlSafeDeviceID}:${uuid.v4()}`;
}
export {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 6:13 AM (18 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2569368
Default Alt Text
D13410.diff (1 KB)
Attached To
Mode
D13410: [lib] Let blob holder generator take deviceID as argument
Attached
Detach File
Event Timeline
Log In to Comment