Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(slack): slack image rendered requires text in title #188

Merged
merged 2 commits into from
Oct 7, 2021

Conversation

tomkcey
Copy link
Contributor

@tomkcey tomkcey commented Oct 7, 2021

The documentation makes no mention of the title property, but the error message as copy/pasted in this issue (#182) clearly states the text property is undefined. There was a null-assertion, so I removed it and added a fallback.

@linear
Copy link

linear bot commented Oct 7, 2021

DEV-1864 [BUG] Slack images will not work if you don`t provide a title (botpress/messaging #182)

Botpress core version: 12.26.3

All though titles are not required for other channels when using the image content-type, if you don`t provide, it will not work in the Slack Channel and an error will be thrown:

[ERROR] web-api:WebClient:0 failed to match all allowed schemas [json-pointer:/blocks/0/title]
[ERROR] web-api:WebClient:0 missing required field: text [json-pointer:/blocks/0/title]
09/28/2021 14:20:49.466 [Messaging] app:slack Error occurred when sending a message. Error: An API error occurred: invalid_blocks
at Object.platformErrorFromResult (C:\snapshot\messaging\node_modules@slack\web-api\dist\errors.js:51:33)
at WebClient.apiCall (C:\snapshot\messaging\node_modules@slack\web-api\dist\WebClient.js:156:28)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async SlackCommonSender.send (C:\snapshot\messaging\packages\server\dist\channels\slack\senders\common.js)
at async SlackConduit.sendToEndpoint (C:\snapshot\messaging\packages\server\dist\channels\base\conduit.js)
at async InstanceService.sendMessageToInstance (C:\snapshot\messaging\packages\server\dist\instances\service.js)
{

to fix this you need to specify a title:

image

Since titles are not required by the content type, I believe the renderer should auto-generate one.

botpress/messaging #182 by @ davidvitora

@tomkcey tomkcey changed the title fix(slack): slack image rendered requires title fix(slack): slack image rendered requires text in title Oct 7, 2021
@laurentlp laurentlp self-requested a review October 7, 2021 14:06
@tomkcey tomkcey marked this pull request as ready for review October 7, 2021 16:44
Copy link
Contributor

@laurentlp laurentlp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and looks fine to me!!

@laurentlp laurentlp merged commit 53141f1 into master Oct 7, 2021
@laurentlp laurentlp deleted the fix/dev-1864 branch October 7, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants