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

Mobile stories block - part 4: error handling #13103

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Oct 11, 2020

This PR builds on top of #13101

This contains all the work needed in order to provide error situation handling when saving or uploading any of the media related to a Story block.

errorhandling2

To test:
CASE A: error in saves

  1. apply this gist https://gist.github.com/mzorz/83b64b49d7a6160cc7beb7c3fd329d15 (this creates an exception the second time the service runs into an image slide to be saved (could be the same 1-slide story being saved more than once or a different slide on the same story)
  2. run WPAndroid
  3. create a story with 1 image slide and at least 1 view, it should be saved and published correctly
  4. now go to the Posts list open the post on mobile gutenberg
  5. select the story block, then tap again or tap on the edit icon button on the block to launch the Story composer
  6. do edits like, move the added view around or add another view
  7. tap on DONE, this should exit the composer and trigger the saving process
  8. observe the process runs into an error and signals Gutenberg to show the failed overlay
  9. tapping on the block should launch the story composer again, in error-wrangling mode
  10. tap on RETRY to attempt a new save (this time it'll work)
  11. now tap on DONE
  12. observe the block gets updated on mobile gutenberg
  13. if you want to see the changes reflected on your site, don't forget to tap on the UPDATE button on the editor as well.

CASE B: error in upload.

  1. create a story with a few slides (3-4 so it takes enough time)
  2. once its uploaded, edit it
  3. tap on the story block and launch the story composer, now edit some views and tap DONE
  4. the story will start uploading
  5. turn airplane mode ON while uploads are still happening
  6. observe the failed upload error overlay is shown
  7. turn airplane mode oFF
  8. tap on the story block failed overlay and observe the dialog appears "Couldn't upload file"
  9. tap RETRY
  10. observe the uploads resume and everything ends up correctly

Related PRs:

Gutenberg mobile: wordpress-mobile/gutenberg-mobile#2708
Gutenberg: WordPress/gutenberg#26008
Jetpack: Automattic/jetpack#17458

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@mzorz mzorz added [Type] Enhancement Gutenberg Editing and display of Gutenberg blocks. gutenberg-mobile labels Oct 11, 2020
@mzorz mzorz added this to the 16.0 milestone Oct 11, 2020
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Oct 11, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Oct 11, 2020

You can test the changes on this Pull Request by downloading the APK here.

@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

Copy link
Contributor

@jd-alexander jd-alexander left a comment

Choose a reason for hiding this comment

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

Thanks for these tests @mzorz all is well from my side. LGTM 🚢

mzorz added 2 commits October 22, 2020 20:43
…move-from-editpostactivity

Mobile stories block - error handling 4.1  - move code out of EditPostActivity
@mzorz mzorz merged commit f1fe044 into feature/jetpack-stories-block-base Oct 23, 2020
@mzorz mzorz deleted the try/jetpack-stories-block-error-handling branch October 23, 2020 00:15
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. [Type] Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants