Skip to content

Conversation

@mzorz
Copy link
Contributor

@mzorz mzorz commented Jan 30, 2019

Introduces Retry/Retry all/Remove for failed media uploads in Gutenberg

gutenberg-mobile PR wordpress-mobile/gutenberg-mobile#528
gutenberg PR WordPress/gutenberg#13615

To test:

CASE A RETRY (single)

  1. start a new draft
  2. insert image block
  3. choose DEVICE LIBRARY
  4. choose an image (better a big one or throttle your connection to make it last)
  5. once it starts uploading, turn airplane mode ON
  6. observe it errors and displays Failed to insert media.\nPlease tap for options.
  7. turn airplane mode OFF
  8. tap on the image
  9. observe the dialog appears with options REMOVE/RETRY ALL/ RETRY
  10. tap on RETRY
  11. observe the image starts to upload again, and finishes successfully.

testa

CASE B RETRY (multiple)

  1. start a new draft
  2. insert image block
  3. insert another image block
  4. choose DEVICE LIBRARY on one of them
  5. choose an image (better a big one or throttle your connection to make it last - I used 2G as preferred network and turned wifi off to make it worse)
  6. once it starts uploading, tap DEVICE LIBRARY on the other block and do the same
  7. once you see both are slowly uploading, turn airplane mode ON.
  8. observe it errors and displays Failed to insert media.\nPlease tap for options.
  9. turn airplane mode OFF
  10. tap on the image
  11. observe the dialog appears with options REMOVE/RETRY ALL/ RETRY
  12. tap on RETRY ALL
  13. observe both images start to upload again

testb2

CASE C REMOVE

  1. repeat steps 1-9 of case A
  2. tap on REMOVE
  3. observe the block is reset as not containing any image.

testc

CASE D: cancel

  1. start a draft
  2. insert an image block
  3. choose an image from the device
  4. while it's uploading, tap on it and observe the "Stop uploading?" dialog appears.
  5. tap YES to cancel upload, or NO to dismiss the dialog.

testd

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@mzorz
Copy link
Contributor Author

mzorz commented Jan 31, 2019

Just added the proper tests description to this PR and lifted the [Not ready for review] label from it @marecar3 . This should be ready for your review now, along with the gutenberg-mobile and gutenberg PRs. Thanks in advance!
cc @SergioEstevao

@mzorz
Copy link
Contributor Author

mzorz commented Jan 31, 2019

Just found an issue: realized that when an image fails to upload, then we exit the Editor, then enter again, we should show it still as failed.
Going to work on that 👌

UploadService.cancelFinalNotification(this, mPost);
UploadService.cancelFinalNotificationForMedia(this, mSite);

ArrayList<MediaModel> failedMedia = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can consider failedMedias or failedMediaList ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 addressed in ccfe884

@marecar3
Copy link
Contributor

Nice work @mzorz!
Especially for detailed test scenarios!

@mzorz
Copy link
Contributor Author

mzorz commented Jan 31, 2019

realized that when an image fails to upload, then we exit the Editor, then enter again, we should show it still as failed.

This case is covered here now as well in commits 4c2d92d and 3f6143c

Copy link
Contributor

@marecar3 marecar3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mzorz mzorz merged commit 89e2c68 into develop Feb 1, 2019
@mzorz mzorz deleted the gb/retry-failed-upload branch February 1, 2019 03:38
@mzorz mzorz mentioned this pull request Feb 1, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants