-
Notifications
You must be signed in to change notification settings - Fork 57
[iOS]Fix: Video Block doesn't continue upload after losing and restoring network connection #1182
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
Conversation
@diegoreymendez 👋I see that recently some changes were made to the media upload on WP-iOS app. Could you help me check if there are some side effects related to those ? You might want to use this branch to experiment because I made a change on gutenberg level to make sure video block is registering for upload events when component is mounted. |
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.
Thank you @pinarol for taking care of this!
I see that the issue where the MediaPlaceholder was disappearing after saving as draft without connection is solved! 🎉
I did spot a couple of issues on this PR, the most important one is probably this one:
- On a new post
- Add a video via recording
- While is uploading, exit the editor via save as draft
- Wait for it to be uploaded
- Open the post again
- The video won't be there, just the placeholder
Here is a video showing the issue: https://cloudup.com/iQqaJKvFnV8
A second problem is more like a glitch and I don't thing that important:
- On a new post
- Add a video from camera roll
- Wait until it successfully finishes to upload
- Edit the video and replace it with a second video from camera roll
- While is updating, stop networking to make it fail
- When the error shows up, save as draft
- The video block will show a black screen with the previous video's URL
- The block's HTML keep the url of the previous block
After networking is restored, the upload state will continue and everything will be solved automatically.
Here is a video showing the problem: https://cloudup.com/i5BoQ5yN_bA
The video shows that closing the editor and going back to the post, the block will show the previous video momentarily while the new video finishes download. This wasn't happening always.
|
@pinarol - The changes we did are just to trigger uploads when the App is opened / comes to foreground and when a connection is re-established. They are new triggers to make the uploads happen but they don't really change any existing logic for uploads. |
|
Good catch @etoledom ! I had to revert the changes that I made to prevent setting the local url in the attributes.src, those issues should be fixed now. It turns out the main app uses that info to update the post content when upload finishes during block editor is closed. So this PR is fixing 2 things only:
Ready for another look |
|
I still can't make sense of why we are receiving upload events with a little delay compared to the past. When I open a post with an ongoing upload the spinner doesn't get visible right away(because no upload events are received from the main app). I remember like it was getting visible quickly in the past. Do you observe the same thing @etoledom ? |
|
@pinarol I updated from develop hoping that the last commit would fix the broken UI Tests |
Yes I did notice a small delay. It's usually quite small, but it looks like when I re-open the post with the ongoing upload on the final stage, the block won't receive any event until it's finished. That last process is usually longer and feels like a bigger delay. |
|
Thank you @pinarol for the update! The first half of the original Issue #1173 it's solved. And the details I noticed on #1182 (review) are both fixed 🎉 I did notice two issues: One seems to be exclusive from this branch, while the second is still reproducible on develop. Issue 1: I wasn't able to reproduce this on develop, but I wonder how can this be affected by this PR. Steps:
I was able to check on web that 2 posts are created at the same time upon saving draft. Issue 2: As I mentioned, this also happens on develop, and we can create a new ticket. Crashes: But again, I find it unlikely that those crashes are exclusive from this branch. |
|
@etoledom 👋Thanks for the detailed testing. I could repro the About
I saw this one too, but after waiting a minute or so it is displaying an error message. So in my case it was not forever but definitely needs a shorter timeout. Let's open issues on WPiOS repo if you think those are not related with this PR. These all seem like good tasks for Groundskeeping. |
|
@marecar3 Could you also check this on WPAndroid? Thanks in advance. |
Thanks for trying it out! Now that you mentioned it, I was able to reproduce it on develop too. Since all the issues I found are not related to this PR, I think it's ✅ to |
|
Hey sorry for missing this one. |
marecar3
left a comment
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.
Seems that every scenario which has been described in the description is working.
LGTM! 👍



Fixes #1173
gutenberg PR: WordPress/gutenberg#16331
There are multiple issues need to be addressed:
Local URL remains in the video block when upload fails.Update: It looks like current upload mechanism depends on this local url to update the post if upload finishes when the block editor is closed. So we can't just remove it.To test:
WPiOS (@etoledom)
WPAndroid (@marecar3)
Update release notes:
RELEASE-NOTES.txt.