From 640237c63051f2e835c2e1384ccc9b4aa61d11f4 Mon Sep 17 00:00:00 2001 From: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com> Date: Fri, 1 Jul 2022 07:30:08 +0800 Subject: [PATCH] tus: don't allow 'notify' to be sent again (#1778) ## Ticket 725 ## Issue Upload a video. When `notify` is sent at the end of the tus upload, refresh immediately. The GUI allowed the user to resume the upload, but the ID is no longer present in the server. ## Approach Until the polling API for `notify` is available, we can only assume the best and let the user know how to handle it. - Store the "notify was sent" state. - Show a dialog explaining the situation. Thought of trying to make `claim_list` calls behind the scenes to clear itself, but it doesn't handle the case of `notify` actually failing. The best is to just let the user handle it for now. Note that for the case of `onerror` actually received, we still retry since a network error could be the culprit (`notify` wasn't sent). --- static/app-strings.json | 7 +++ .../internal/web-upload-item.jsx | 53 ++++++++++++++++++- ui/redux/reducers/publish.js | 6 +++ web/setup/publish-v2.js | 3 ++ 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 1121948d2..7ee16ff5f 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1147,6 +1147,13 @@ "Stopped. Duplicate session detected.": "Stopped. Duplicate session detected.", "File being uploaded in another tab or window.": "File being uploaded in another tab or window.", "There are pending uploads.": "There are pending uploads.", + "Processing file. Please wait...": "Processing file. Please wait...", + "File uploaded to server.": "File uploaded to server.", + "Remove entry?": "Remove entry?", + "The file was successfully uploaded, but we could not retrieve the confirmation status.": "The file was successfully uploaded, but we could not retrieve the confirmation status.", + "Wait 5-10 minutes, then refresh and check the Uploads list and Wallet transactions before attempting to re-upload.": "Wait 5-10 minutes, then refresh and check the Uploads list and Wallet transactions before attempting to re-upload.", + "This entry can be safely removed if the transaction is visible in those pages.": "This entry can be safely removed if the transaction is visible in those pages.", + "Press OK to clear this entry from the \"Currently Uploading\" list.": "Press OK to clear this entry from the \"Currently Uploading\" list.", "Use a URL": "Use a URL", "Edit Cover Image": "Edit Cover Image", "Cover Image": "Cover Image", diff --git a/ui/component/webUploadList/internal/web-upload-item.jsx b/ui/component/webUploadList/internal/web-upload-item.jsx index 10d930f85..b230e8e77 100644 --- a/ui/component/webUploadList/internal/web-upload-item.jsx +++ b/ui/component/webUploadList/internal/web-upload-item.jsx @@ -75,7 +75,11 @@ export default function WebUploadItem(props: Props) { } if (!uploader) { - return __('Stopped.'); + if (status === 'notify') { + return __('File uploaded to server.'); + } else { + return __('Stopped.'); + } } if (resumable) { @@ -87,6 +91,8 @@ export default function WebUploadItem(props: Props) { return __('Failed.'); case 'conflict': return __('Stopped. Duplicate session detected.'); + case 'notify': + return __('Processing file. Please wait...'); default: return status; } @@ -108,7 +114,14 @@ export default function WebUploadItem(props: Props) { // Should still be uploading. Don't show. return null; } else { - // Refreshed or connection broken. + // Refreshed or connection broken ... + + if (status === 'notify') { + // ... but 'notify' sent, so we have to assume it is processed. + // Can't do much until the polling API is available. + return null; + } + const isFileActive = file instanceof File; return (