Fix Unsupported Block Editor on account created prior to December 2018#16586
Conversation
Fixes wordpress-mobile/gutenberg-mobile#3425 The `/sites/{site_id}/gutenberg` endpoint is unreliable (see wordpress-mobile/gutenberg-mobile#3425 (comment)) but was being used to disable the UBE on sites where gutenberg was unavailable. Since most users will have gutenberg enabled in this scenario, it makes sense to remove usage of this API endpoint and just show a failure state if gutenberg is unavailable. The failure state will show information on how to fix the error (i.e. enable gutenberg on the site).
|
You can trigger an installable build for these changes by visiting CircleCI here. |
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
|
Testing 82baaaf: Feature tests
Regression tests
I'm getting the Loading Failed Screen here and the error I see in the console is: Will investigate what could be the problem here. Update: This was due to the WP.com login screen being shown, which is expected, and the Loading Screen was not being dismissed. |
This fixes a bug I caught when testing where the loading screen would be shown above the UBE's content when it asks you to log in via WP.com.
|
Testing 8b98659: Feature tests
Regression testsTaken from wordpress-mobile/test-cases#78:
|
|
Questions:
|
illusaen
left a comment
There was a problem hiding this comment.
LGTM!
Just as a quick note: I tend to like pulling out string constants into a small struct so I can have them all in one place but that might not be the style in WPiOS.
I like that, it would've probably made the code easier to read here. Thanks for the tip, I'll keep it in mind for next time. |
Do you have any thoughts about this, @illusaen? Does the text get the message across or do you think it could be improved? |
|
I'm going to bump the milestone on this because the Android side is in-progress and I think it makes sense to ship this change on both platforms at the same time. Reason being that this is part visual change, part bug-fix, and handling a different scenario on each platform in manual test cases and beta testing would add unnecessary overhead. |
|
Thanks for the heads up Paul, just want to mention that I'm AFK next week but will tidy up the Android PR and request a review when I'm back. :) |
|
I'm running the 17.6 code freeze today. This has 17.6 milestone and is approved, but, given @guarani's suggestion to wait for the Android counterpart to be ready and @SiobhyB message about being AFK and there being a bit of tidy up left to do, I'm going to bump this to 17.7. Android 17.6 does the code freeze today, too, so there's no way the Android counterpart will make into that version. Do let me know if this is not the best course of action and we'll adjust 👍 |
|
Thanks for updating the milestone, @mokagio! Apologies for not updating earlier. |
I think it makes sense to me. :) |
|
@guarani No worries at all! 🙌 |
|
We agreed in wordpress-mobile/WordPress-Android#14762 (comment) to merge this PR for inclusion in 17.7. |
Description
Addresses wordpress-mobile/gutenberg-mobile#3425 (fixes for iOS, not Android)
The
/sites/{site_id}/gutenbergendpoint is unreliable but was being used to check if Gutenberg was available on a site's backend, and if so, disable the Unsupported Block Editor (UBE).Since the majority of users will have Gutenberg enabled, it makes sense to remove usage of this unreliable API endpoint. What we do instead in this PR is:
To test
Feature tests
See wordpress-mobile/gutenberg-mobile#3425. The testing steps here are:
(?)to open the web editor (UBE)Regression tests
Go through the following test cases (taken from here) and make sure the New Loading Screen is shown while the UBE loads. In TC004, the Loading Failed Screen should be shown after a 15 second timeout.
Regression Notes
This could somehow cause issues with the Unsupported Block Editor loading, so it's important to test this across all site types.
The manual test cases above aim to cover these areas of impact.
This PR adds a loading screen that relies on the underlying network request. Mocking this seems tricky, both as a unit test or a UI test (using https://github.com/wordpress-mobile/WordPressMocks).
PR submission checklist:
RELEASE-NOTES.txtif necessary.