UMAprotocol / protocol

UMA Protocol Running on Ethereum
https://uma.xyz
GNU Affero General Public License v3.0
361 stars 175 forks source link

fix: avoid empty blocks in slack transport #4647

Closed Reinis-FRP closed 9 months ago

Reinis-FRP commented 9 months ago

Motivation

Currently Slack transport can error under certain conditions when splitting lines.

Summary

Fixes Slack transport to avoid sending empty blocks.

Details

Slack webhook treats empty text blocks as invalid. This could have happened in splitByNewLine if the first line already exceeds Slack character limit. The fix avoids this by not starting the smallerBlocks array with createSectionBlock("").

Testing

Check a box to describe how you tested these changes and list the steps for reviewers to test.

Issue(s)

Fixes #XXXX