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

Remove failed uploads is not working in block editor #9953

Closed
mkevins opened this issue May 29, 2019 · 4 comments
Closed

Remove failed uploads is not working in block editor #9953

mkevins opened this issue May 29, 2019 · 4 comments
Labels
Gutenberg Editing and display of Gutenberg blocks. Media [Type] Bug

Comments

@mkevins
Copy link
Contributor

mkevins commented May 29, 2019

Description

I encountered an issue with media blocks (video and image) after a failed upload. When I have a failed upload in a post, I am unable to "UPDATE" the post after that point, and "REMOVE FAILED UPLOADS" does not seem to work. If I "RETRY" the upload successfully, or "REMOVE" the media from the "Please tap for options" dialog, "UPDATE" resumes working normally. However, if I remove the block via the trash icon, I can no longer "UPDATE" the post, and I cannot "REMOVE" the failed uploads. This results in a condition where my local changes can never be uploaded.

Steps to reproduce the behavior

  1. Open a post (with the block editor).
  2. Add an image block.
  3. Put device in ✈️ airplane mode.
  4. Select Add Image -> Choose from device.
  5. Select an image (observe that the upload fails with "Failed to insert media. ...").

  1. Tap the 🗑️ trash icon to remove the block.
  2. Turn off ✈️ airplane mode.
  3. Tap "UPDATE" to upload the changes to the server.

Expected behavior

The changes should save to the server.

Actual behavior

Saving the changes is prevented with the following dialog: "Some media uploads have failed. You can't save or publish your post in this state. Would you like to remove all failed media?" Options: { "CANCEL", "REMOVE FAILED UPLOADS"}.

Selecting "REMOVE FAILED UPLOADS" does not appear to have any effect.

Screencast

Originally encountered while testing video block:

Tested on Pixel 2 Emulator, Android 27, WPAndroid 654bf6d

Additional information

The GutenbergEditorFragment has a method hasFailedMediaUploads which returns true if the post still has mFailedMediaIds. This prevents the post from updating, and results in showRemoveFailedUploadsDialog being called instead. The removeAllFailedMediaUploads method, however, does not remove anything. In examining the code, I noticed that the isUploadingMedia method of the same class always returns false. This seems to suggest that the responsibility of tracking upload progress is not intended to be handled by this class. @hypest wdyt?

@mkevins mkevins added [Type] Bug Gutenberg Editing and display of Gutenberg blocks. gutenberg-mobile Media labels May 29, 2019
@hypest
Copy link
Contributor

hypest commented May 29, 2019

This seems to suggest that the responsibility of tracking upload progress is not intended to be handled by this class.

Allow me to summon @mzorz on this one as I'm sure Mario will have good context to add on this.

@stale
Copy link

stale bot commented Jun 2, 2020

This issue has been marked as stale because:

  • It has been inactive for the past year.
  • It isn't in a project or a milestone.
  • It hasn’t been labeled [Pri] Blocker, [Pri] High, or good first issue.

Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority (cc @designsimply).

@stale stale bot added the [Status] Stale label Jun 2, 2020
@mzorz
Copy link
Contributor

mzorz commented Jun 2, 2020

hi @mkevins Is this issue still valid? let me know :D thanks!

@stale stale bot removed the [Status] Stale label Jun 2, 2020
@mkevins
Copy link
Contributor Author

mkevins commented Jun 5, 2020

😄 This appears to no longer be an issue. I retested on 14.9 via the steps described (using "save" instead of "update"), on both a new post as well as an already existing post, and the post can be saved after removal of the block containing failed media. Note: the media is still queued for upload, and uploads when the post is saved, but this does not prevent the post from being saved, which was the original cause for the issue.

@mkevins mkevins closed this as completed Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Media [Type] Bug
Projects
None yet
Development

No branches or pull requests

3 participants