CircleCI-Public / slack-orb

Create custom Slack notifications for CircleCI job statuses
https://circleci.com/developer/orbs/orb/circleci/slack
MIT License
212 stars 205 forks source link

Sending notification is marked as successful on an "invalid_blocks" response #418

Open alexeyr-ci opened 1 year ago

alexeyr-ci commented 1 year ago

Orb version:

4.11.0

What happened:

I tried to include CircleCI artifact URLs as "type": "image" blocks. This lead to

The response from the API call to Slack can be found below. To view redacted values, rerun the job with SSH and access: slack-orb-logs.FVj3A8/response.json
{"ok":false,"error":"invalid_blocks","errors":["downloading image failed [json-pointer:\/blocks\/2\/image_url]","downloading image failed [json-pointer:\/blocks\/3\/image_url]","downloading image failed [json-pointer:\/blocks\/4\/image_url]","downloading image failed [json-pointer:\/blocks\/5\/image_url]","downloading image failed [json-pointer:\/blocks\/6\/image_url]","downloading image failed [json-pointer:\/blocks\/7\/image_url]","downloading image failed [json-pointer:\/blocks\/8\/image_url]","downloading image failed [json-pointer:\/blocks\/9\/image_url]","downloading image failed [json-pointer:\/blocks\/10\/image_url]","downloading image failed [json-pointer:\/blocks\/11\/image_url]"],"warning":"missing_charset","response_metadata":{"messages":["[ERROR] downloading image failed [json-pointer:\/blocks\/2\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/3\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/4\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/5\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/6\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/7\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/8\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/9\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/10\/image_url]","[ERROR] downloading image failed [json-pointer:\/blocks\/11\/image_url]"],"warnings":["missing_charset"]}}
Slack API returned an error message:
"invalid_blocks"

but the step is marked as successful image

Expected behavior:

I expect it to be shown as a failure. In my case it doesn't affect the overall job status, since this notification is only sent on failure anyway, but it could matter in other cases.

Additional Information:

mayank0202 commented 5 months ago

Please use circleci/slack@4.12.6 and everything will be resolved