-
Notifications
You must be signed in to change notification settings - Fork 57
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
Image/Media-Text: Low resolution image is uploaded if you close/re-open post during upload #1510
Comments
Tested on WPAndroid develop with 1.15.1: I saw the red screen from #1509 but the uploaded image was full resolution, and there was only one item in the media library |
I'll add some root cause analysis I made about this. This is happening because there's a Actually for media-text we don't need to call |
BTW I remember trying to store the low res url in state rather than putting into attributes but that time it is reset if we close/reopen the post and so it didn't work. |
I was thinking maybe we could store that in state. I've been trying to understand the whole media upload process and I have some questions. I understand it's valuable to store some temporary data like the upload ID and url so that the app can finish the upload async and replace the content even with the editor closed. But what happens if, let's say, the app crashes during upload? Would the existing attributes still be enough to match them with existing media and allow the user to retry the upload? Could we do the same thing by relying only on mediaId and only changing the url when it's final? I guess that would need to improve the parsing beyond a regular search and replace like we discussed, but are there other things that I'm missing? What I've seen so far (on the image block) is that the block attributes get updated a few times during upload (which matches what I noticed with the multiple undo steps):
|
I tried that one: #1510 (comment) but state is getting reset when we close/re-open the post or so we won’t be able to show the low res image again during upload.
It will match by using the upload mediaId if the main app is capable of continuing the upload. Let’s say the upload failed and the main app wasn’t able to tell the editor that it was failed, and the upload is just not continuing. Then the user needs to start over currently. It should be possible to make use of requestMediaImport to start the upload but we need to be able to distinguish the low res url from the original local url. |
Fixed via WordPress/gutenberg#18215 (Automatic closing issues seems to not be working ¯\_(ツ)_/¯) |
Detected during testing #1503.
Also reproducible @ 9f4afd6
develop
Tested with iPhone 8 plus, iOS 13.1
Reality
This is happening on Image block as well but it is less noticeable since the cover image has higher resolution.
Expected
The text was updated successfully, but these errors were encountered: