Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,46 @@ export default class UploadHandler {
this.actionBinder.getAdditionalHeaders() || {},
{ body: JSON.stringify(finalAssetData), signal },
);
finalizeOpts.keepalive = true;
this.networkUtils.fetchFromServiceWithRetry(
const finalizeJson = await this.networkUtils.fetchFromServiceWithRetry(
this.actionBinder.acrobatApiConfig.acrobatEndpoint.finalizeAsset,
finalizeOpts,
this.actionBinder.workflowCfg.targetCfg.fetchApiConfig.finalizeAsset,
).catch(() => {});
} catch (e) { /* fire-and-forget */ }
);
if (!finalizeJson || Object.keys(finalizeJson).length !== 0) {
if (this.actionBinder.MULTI_FILE) {
await this.actionBinder.dispatchErrorToast('upload_error_finalize_asset', 500, `Unexpected response from finalize call: ${assetData.id}, ${JSON.stringify(finalizeJson || {})}`, false, true, {
code: 'upload_error_finalize_asset',
desc: `Unexpected response from finalize call: ${assetData.id}, ${JSON.stringify(finalizeJson || {})}`,
});
return false;
}
await this.showSplashScreen();
await this.actionBinder.dispatchErrorToast('upload_error_finalize_asset', 500, `Unexpected response from finalize call: ${assetData.id}, ${JSON.stringify(finalizeJson)}`, false, true, {
code: 'upload_error_finalize_asset',
desc: `Unexpected response from finalize call: ${assetData.id}, ${JSON.stringify(finalizeJson)}`,
});
this.actionBinder.operations = [];
return false;
}
} catch (e) {
if (e.name === 'AbortError') return false;
if (this.actionBinder.MULTI_FILE) {
await this.actionBinder.dispatchErrorToast('upload_error_finalize_asset', e.status || 500, `Exception thrown when verifying content: ${e.message}, ${assetData.id}`, false, e.showError, {
code: 'upload_error_finalize_asset',
subCode: e.status,
desc: `Exception thrown when verifying content: ${e.message}, ${assetData.id}`,
});
return false;
}
await this.showSplashScreen();
await this.actionBinder.dispatchErrorToast('upload_error_finalize_asset', e.status || 500, `Exception thrown when verifying content: ${e.message}, ${assetData.id}`, false, e.showError, {
code: 'upload_error_finalize_asset',
subCode: e.status,
desc: `Exception thrown when verifying content: ${e.message}, ${assetData.id}`,
});
this.actionBinder.operations = [];
return false;
}
return true;
}

Expand Down
Loading