You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
elements have a compatibleWith method which returns an array of block types. Both elements and blocks have a getType method that will return the block or element's type.
Since slack only supports certain elements within certain blocks, a request exception would be thrown if a message was sent with an incompatible element within a block.
Before making the message request we should validate the incoming blocks and ensure that each element within them is compatible with the block it is part of. To keep things seamless I think we should go ahead and filter out the incompatible elements and just send the blocks array with compatible elements. This would at least allow partial messages to come through.
Alternatively we could throw an InvalidArgumentException specifying the invalid elements. This would result in end users not receiving messages (even partial messages) if there is an invalid element in a block. An error should be logged to the end user's error log, at which point the developer could make changes to their notification setup.
The text was updated successfully, but these errors were encountered:
elements have a
compatibleWith
method which returns an array of block types. Both elements and blocks have agetType
method that will return the block or element's type.Since slack only supports certain elements within certain blocks, a request exception would be thrown if a message was sent with an incompatible element within a block.
Before making the message request we should validate the incoming blocks and ensure that each element within them is compatible with the block it is part of. To keep things seamless I think we should go ahead and filter out the incompatible elements and just send the blocks array with compatible elements. This would at least allow partial messages to come through.
Alternatively we could throw an
InvalidArgumentException
specifying the invalid elements. This would result in end users not receiving messages (even partial messages) if there is an invalid element in a block. An error should be logged to the end user's error log, at which point the developer could make changes to their notification setup.The text was updated successfully, but these errors were encountered: