Skip to content

Commit ce46a2c

Browse files
authored
fix: slack empty mention and workflow replies (#300)
*Issue #, if available:* *Description of changes:* Fix the below issues: 1. When the slack app is mentioned with an empty message, it throws Bedrock validation error. 2. When Slack workflow mentiones the app, the reply contains an invalid mention. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 06ea826 commit ce46a2c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/slack-bolt-app/src/handlers/message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export async function handleMessage(
106106
type: 'section',
107107
text: {
108108
type: 'mrkdwn',
109-
text: `Hi <@${userId}>, please wait for your agent to launch.\n\n*Useful Tips:*`,
109+
text: `${userId ? `Hi <@${userId}>, p` : 'P'}lease wait for your agent to launch.\n\n*Useful Tips:*`,
110110
},
111111
},
112112
{

packages/slack-bolt-app/src/util/history.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export const saveConversationHistory = async (
1111
imageS3Keys: string[] = []
1212
) => {
1313
const content = [];
14-
if (message) {
15-
content.push({ text: renderUserMessage({ message }) });
16-
}
14+
content.push({ text: renderUserMessage({ message }) });
1715
imageS3Keys.forEach((key) => {
1816
content.push({
1917
image: {

0 commit comments

Comments
 (0)