-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post publish upload media dialog: handle upload errors #64823
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Nice! The only change I'd make is I wouldn't use the red alert color, so you can delete that CSS. Otherwise, 👍 👍 |
Thank you, @jasmussen! 👍 I've deleted the CSS, as you suggested. Do you feel strongly about keeping vs dropping the classname? |
Size Change: +35 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
I'd lean towards dropping the classname. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use a code check too.
Flaky tests detected in 2c4ad77. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10576658487
|
Done, thanks again! |
@@ -114,6 +116,7 @@ export default function PostFormatPanel() { | |||
resolve(); | |||
}, | |||
onError() { | |||
setHadUploadError( true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only catches errors from media upload
; we also need to catch errors for window.fetch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This promise chain is getting fun 😄
I added a catch-all to the end of each individual upload. That should catch any errors / rejections, whether they come from the window.fetch
or one of the later steps.
How does that look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the follow-up, @sgomes!
Thank you for the review, @Mamaduka! 👍 Unfortunately it seems we'll need yet another PR, since there seems to be a race condition in media uploads, where they sometimes end up sharing an ID 😞 Still investigating that one, will follow up with bug report and a fix too, if I can manage it. |
@sgomes, that's not good. Feel free to ping if you need any help. |
FYI, I'm still investigating the race condition, but it seems to be happening on the server somewhere (either the REST API or a bit deeper). I'll add a link here once I have something. |
Thanks, @sgomes! Side note: Gutenberg merge commits now require including props generated by the props-bot at the end of the merge commit. |
Oh, sorry about that 😞 I missed the bit where it needs to be done manually. |
For anyone following this thread, I created #64899 for the race condition I briefly mentioned above. |
* Post publish upload media dialog: handle upload errors * Change text color * Drop unused classname * Add catch-all for any errors during upload * Remove redundant setHadUploadError call
What?
This PR adds minimal information to the post publish upload media dialog when an upload error takes place. Previously, it would simply show the upload button again.
This is a follow-up to #64741.
Why?
It's important to communicate that something went wrong during the upload process.
How?
Some simple text is displayed until the upload is tried again. Here is a video of how this looks:
Error.on.upload.mov
Testing Instructions
Testing Instructions for Keyboard
N/A
Screenshots or screencast