Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

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

Closed

Description

@chipsnyder

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

Activity

  1. added this to the 1.23 milestone on Feb 18, 2020
  2. changed the title [-]Gallery Upload fails to upload image[/-] [+]Gallery Upload fails to upload image when leaving and coming back in[/+] on Feb 18, 2020
  3. pinarol commented on Feb 18, 2020

    @pinarol
    Contributor

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

  4. 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[/+] on Feb 18, 2020
  5. chipsnyder commented on Feb 18, 2020

    @chipsnyder
    ContributorAuthor

    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.

  6. removed this from the 1.23 milestone on Feb 18, 2020
  7. pinarol commented on Feb 18, 2020

    @pinarol
    Contributor

    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
  8. chipsnyder commented on Feb 18, 2020

    @chipsnyder
    ContributorAuthor

    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.

  9. cameronvoell commented on Feb 18, 2020

    @cameronvoell
    Contributor

    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.

  10. mkevins commented on Feb 19, 2020

    @mkevins
    Contributor

    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?

  11. chipsnyder commented on Feb 19, 2020

    @chipsnyder
    ContributorAuthor

    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.

  12. cameronvoell commented on Feb 19, 2020

    @cameronvoell
    Contributor

    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.

  13. pinarol commented on Feb 19, 2020

    @pinarol
    Contributor

    Right, I tried with a post as well.

  14. mchowning commented on Feb 19, 2020

    @mchowning
    Contributor

    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.

  15. pinarol commented on Jun 22, 2020

    @pinarol
    Contributor

    Should be resolved with associated PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [OS] Android[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions