Page MenuHomePhabricator

D13654.id45004.diff
No OneTemporary

D13654.id45004.diff

diff --git a/lib/push/send-hooks.react.js b/lib/push/send-hooks.react.js
--- a/lib/push/send-hooks.react.js
+++ b/lib/push/send-hooks.react.js
@@ -320,17 +320,17 @@
);
}
- if (assignmentResult.success) {
+ if (assignmentResult.result === 'success') {
return;
}
- if (assignmentResult.error) {
+ if (assignmentResult.result === 'error') {
const { statusText } = assignmentResult;
console.log(`Failed to assign all holders. Status text: ${statusText}`);
return;
}
- for (const [blobHash, holder] of assignmentResult.failedAssignments) {
+ for (const [blobHash, holder] of assignmentResult.failedRequests) {
console.log(`Assingnemt failed for holder: ${holder} and hash ${blobHash}`);
}
}
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
@@ -116,13 +116,14 @@
holders: $ReadOnlyArray<{ +blobHash: string, +holder: string }>,
headers: { [string]: string },
): Promise<
- | { +success: true }
- | { +error: true, status: number, statusText: string }
+ | { +result: 'success' }
+ | { +result: 'error', +status: number, +statusText: string }
| {
- +failedAssignments: $ReadOnlyArray<{
+ +failedRequests: $ReadOnlyArray<{
+blobHash: string,
+holder: string,
}>,
+ +result: 'failed_requests',
},
> {
const assignMultipleHoldersResponse = await fetch(
@@ -140,7 +141,7 @@
if (!assignMultipleHoldersResponse.ok) {
const { status, statusText } = assignMultipleHoldersResponse;
- return { error: true, status, statusText };
+ return { result: 'error', status, statusText };
}
const { results } = await assignMultipleHoldersResponse.json();
@@ -149,10 +150,10 @@
.map(({ blobHash, holder }) => ({ blobHash, holder }));
if (failedRequests.length !== 0) {
- return { failedAssignments: failedRequests };
+ return { result: 'failed_requests', failedRequests };
}
- return { success: true };
+ return { result: 'success' };
}
async function removeMultipleHolders(

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 3:34 PM (19 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2695164
Default Alt Text
D13654.id45004.diff (2 KB)

Event Timeline