Repository navigation
Block Directory: Throw error if we have an issue registering blocks. - #23439
Conversation
|
Size Change: +303 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
I think so, yes. If it's a problem that we know can't be solved by retrying then that's a better experience. Ideally we shouldn't return broken blocks in search results in the first place, but it makes sense to have a way of handling them. |
|
@ryelle What are your thoughts here? I don't want to invest too much time in this direction if we think there's a better approach (which is why this is still draft). |
|
I think you're on the right track. Maybe you could show a "reload" button instead of "retry" for these kinds of errors? If it's not a hassle - ideally this situation would be very rare, since the wp.org block validation should catch these errors before the blocks get added to the directory, right? |
There was a problem hiding this comment.
Why not set a bottom margin on block-directory-downloadable-block-notice__content?
There was a problem hiding this comment.
Ah good catch. This was from the iteration where the button didn't exist if fatal. Now we always persist a button (reload btn now), so I'll revert back.
There was a problem hiding this comment.
We generally avoid abbreviated variable names, so this can be message
There was a problem hiding this comment.
Yep, sounds good.
|
I added 2a28f968daced4ad3e7f5fda6bbc52375638d197 to disable the "Add Block" button when a block has a fatal notice, and ad5e50c1c43274a1485291d8522d3b5ea5609274 to clean up the error messages a bit. |
|
It also looks like the tests need to be updated, or the |
Yep, will get to those today. |
ad5e50c to
7b43fca
Compare
ryelle
left a comment
There was a problem hiding this comment.
👍 Fixes the issue with errors we can detect, so this is a good improvement.
|
Does it make sense to do this for all |
No, you are correct. Under a bit of a time crunch, we focused on handling the error cases we saw during third party testing to provide more useful user error messages. We'll follow this up and test more api errors, and most likely cover all |
Description
When a third party block fails during the installation process, we should alert the user to give them context.
How has this been tested?
Types of changes
reloadfromretryif error is known to befatal.folder_exists,unable_to_connect_to_filesystem.Assumptions
This PR doesn't try to handle all the use cases but instead identifies the ones we know to be fatal or introduce and awkward experience. All other unhandled but thrown errors will allow user's the opportunity to retry.
Screenshots
unable_to_connect_to_filesystemChecklist: