Skip to content
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

Media Upload fails to upload image when leaving and coming back in #1928

Closed
chipsnyder opened this issue Feb 18, 2020 · 11 comments
Closed

Media Upload fails to upload image when leaving and coming back in #1928

chipsnyder opened this issue Feb 18, 2020 · 11 comments
Labels
[OS] Android [Type] Bug Something isn't working

Comments

@chipsnyder
Copy link
Contributor

chipsnyder commented Feb 18, 2020

Describe the bug
Close/Re-opening a page with ongoing image uploads in a Gallery Block causes the image to be marked for retry.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Draft Page or select an existing page.
  2. Add a Gallery or Image Block
  3. Select Add Media
  4. Select "Choose From Device"
  5. Select an Image
  6. While the image is uploading; select back
  7. Go right back into the Page

Error: Image gets locked into a mode where it's tagged to be uploaded
Expected: Image should upload successfully and reflect the proper state.

https://github.com/wordpress-mobile/test-cases/blob/master/test-cases/gutenberg/gallery.md#tc001

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
FailedUpload_GalleryTC001 2020-02-18 09_38_50

Smartphone (please complete the following information):

  • Device: Pixel 3a
  • OS: Android 10
  • Version API 29

APK used to test

Additional context
Discovered during regression testing for Release 1.23.0

@chipsnyder chipsnyder added [Type] Bug Something isn't working [OS] Android labels Feb 18, 2020
@chipsnyder chipsnyder added this to the 1.23 milestone Feb 18, 2020
@chipsnyder chipsnyder changed the title Gallery Upload fails to upload image Gallery Upload fails to upload image when leaving and coming back in Feb 18, 2020
@pinarol
Copy link
Contributor

pinarol commented Feb 18, 2020

What happens when we dismiss the retry dialog? Does it complete successfully?

@chipsnyder chipsnyder changed the title Gallery Upload fails to upload image when leaving and coming back in Media Upload fails to upload image when leaving and coming back in Feb 18, 2020
@chipsnyder
Copy link
Contributor Author

chipsnyder commented Feb 18, 2020

For me when the app was uploading a new page and a new image it was just hanging on the upload for a new page and never completing (waited for a few minutes). However, if I can fix this issue by:

  1. Tap the image
  2. Select Retry
  3. Tap the image
  4. Select Cancel
  5. Back out to Site Pages

Then the page uploads successfully. Just revalidated a few flows and this looks like it's an issue on other media blocks as well not just gallery.

@pinarol pinarol removed this from the 1.23 milestone Feb 18, 2020
@pinarol
Copy link
Contributor

pinarol commented Feb 18, 2020

I can repro this with the same apk on Android(Huawei p20 lite, Android 9.0):

  • Add an image block
  • Start an upload
  • Close/Re-open the post while the upload is still going on

Expected:

  • The post loads immediately showing an upload progress on the Image block
  • Image upload continues and end up with success

Reality:

  • The post displays white screen until the upload is complete(the upload is observable on device's status bar only)
  • There's no progress indication on Image block
  • Image block still shows the local image even after waiting some time(checked on the html editor)
  • When I tap on the image, "Retry" dialog is shown

@chipsnyder
Copy link
Contributor Author

After performing the steps in the previous comment, in the notification center, I see the Uploading dialog for "1 page and 1 file."
screenshot-1582044835640

To fix this apparent lock between the media uploader and the page publish, you can do one of the following:
Possible fixes are:
A) restart the phone
B) Click on the image and remove (either via remove on retry prompt or retry and cancel)
C) Loose network through airplane mode or wifi and get the network back. Then go back to site pages

Any of those seem to allow the page to upload successfully.

Also worth noting in the HTML view of the page, you'll see a local URL for the media. However, in my case, when I went to https://wordpress.com/media/{site name}, then I saw the image had successfully uploaded.

@cameronvoell
Copy link
Contributor

cameronvoell commented Feb 18, 2020

So far, I verified the bug was not in initially could not reproduce this Bug in WPAndroid release 14.1 but I could reproduce it in WPAndroid 14.2.

Looks like the new behavior actually started with the React Native upgrade (can reproduce on this commit, but not on the 14.1 release). Rather than running through those updates (too much :-P) to see what broke it, I'm just going to debug the upload code and see if we can get a fix.

@mkevins
Copy link
Contributor

mkevins commented Feb 19, 2020

Hi @chipsnyder 👋 ,

Thanks for testing this flow on the release. I was unable to reproduce this issue, following the same steps. I tried on:

via Pixel 3a (Android 10).

In all cases, I observed the expected behavior for this flow, so perhaps there is some subtle difference in our actions to arrive at different results (or maybe some race condition)?

Here is a screencast of my test:

Can you see whether anything is different about the flow I used?

@chipsnyder
Copy link
Contributor Author

Hey @mkevins, In your gif, it looks like you might be creating a new post instead of a new page. Try creating a new page instead. In my testing posts were fine, but pages had problems.

@cameronvoell
Copy link
Contributor

cameronvoell commented Feb 19, 2020

Reality:
The post displays white screen until the upload is complete(the upload is observable on device's status bar only)

@mkevins @chipsnyder I definitely was seeing the issue with Posts also, and I think Pinar was too, unless the above was a mistype.

Still not sure why Matt is not producing the issue, his steps look the same as mine. I did have to switch to slower mobile network and larger photos to make sure I was not loading too fast when switching back and forth. But the loading bar in Matt's video seems to show that the image is still loading, so not sure why he is not seeing the issue.

@pinarol
Copy link
Contributor

pinarol commented Feb 19, 2020

Right, I tried with a post as well.

@mchowning
Copy link
Contributor

mchowning commented Feb 19, 2020

I'm seeing the following in my testing:

  1. Create a post and add a new image that must be uploaded
  2. Exit the post editor
  3. Reopen the post editor
  4. Then
    a. If the image uploads before I try to reopen the post in the editor: the image id and url update correctly
    b. If the image uploads as the editor is opening: the image id and url do not update and the local id and local file path remain. This results in the retry upload dialog when you tap on the image. But my media library shows that the image uploaded successfully. In addition, exiting the post on mobile shows that the post is still a local draft. If I then exit to the main screen on the app and return to the posts screen, the post upload is initiated. Of course, since the post has the local media id and file url, it will not display properly on the web.
    c. If the image uploads after the editor has reloaded the post: the image updates with the correct id and url once the upload completes.

In the scenario where the upload finishes after the post has been reopened in the editor (4c), I did not observe any UI indication that the upload was still in progress with image blocks. Gallery blocks, on the other hand, did have the upload progress bar as like in @mkevins comment and gif.

I recreated this issue on the 14.1 release (the only other release I tested), so this does not appear to me to be a new regression.

I could not recreate this issue on iOS because iOS appears to block the user from reopening a post while it is in the process of being uploaded.

@pinarol
Copy link
Contributor

pinarol commented Jun 22, 2020

Should be resolved with associated PRs

@pinarol pinarol closed this as completed Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[OS] Android [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants