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

rich_text_input not recognizing skin tone emojis in Windows OS (invalid emoji name error) #2381

Open
dianexjeong opened this issue Jan 3, 2025 · 2 comments

Comments

@dianexjeong
Copy link

(Filling out the following with as much detail as you can provide will help us solve your issue sooner.)

@slack/bolt version

^3.21.1

Your App and Receiver Configuration

const receiver = new ExpressReceiver({
  signingSecret: process.env.SLACK_SIGNING_SECRET,
  port: process.env.SLACK_APP_PORT,
  clientId: process.env.SLACK_CLIENT_ID,
  clientSecret: process.env.SLACK_CLIENT_SECRET,
  stateSecret: "my-state-secret",
  scopes: ["chat:write", "chat:write.customize", "im:history", "im:write", "users:read", "users:read.email"],
  installerOptions: {
    userScopes: ["im:write", "chat:write"]
  }
...
})

const app = new App({
  receiver,
});

Node.js runtime version

v20.18.1

Steps to reproduce:

  1. Create a view (in my case it was a modal) with a rich_text_input element
  {
                type: "input",
                block_id: "block-id-0",
                element: {
                  type: "rich_text_input",
                  placeholder: {
                    type: "plain_text",
                    text: "placeholder text",
                    emoji: true,
                  },
                  action_id: "action-id-0",
                },
                label: {
                  type: "plain_text",
                  text: "label text",
                  emoji: true,
                },
},
  1. Submit the modal with a skin tone emoji (ex. :woman-tipping-hand::skin-tone-3:) *Test separately in Windows and Mac
  • In Windows, the submitted JSON body element of the emoji rich text looks like this:
{
  "type": "rich_text",
  "elements": [
    {
      "type": "rich_text_section",
      "elements": [{ "name": "woman-tipping-hand::skin-tone-3", "type": "emoji" }]
    }
  ]
}
  • and in Mac:
{
  "type": "rich_text",
  "elements": [
    {
      "type": "rich_text_section",
      "elements": [{ "name": "woman-tipping-hand", "type": "emoji", "unicode": "1f481-1f3fc-200d-2640-fe0f" }]
    }
  ]
}
  1. Handle the view submission and call a chat.postMessage API and directly use the submitted body of the rich text
 const messageRichTextBody = view.state.values.message_rich_text.acknowledger.rich_text_value;
      const fullMessageBlocksArray = [
        {
          type: "header",
          text: {
            type: "plain_text",
            text: messageTitle,
          },
        },
        messageRichTextBody,
      ];

 await client.chat.postMessage({
          channel: channel
          blocks: fullMessageBlocksArray,
          text: messageTitle,
        });
  1. I get an error like the following when sending the message with Windows OS but works fine with Mac.
    errors: [ 'invalid emoji name woman-tipping-hand::skin-tone-3' ],

Expected result:

The postMessage call works fine with Mac, and the :woman-tipping-hand::skin-tone-3: emoji that I submitted through the rich_text_input modal gets sent perfectly as a Slack message.

Actual result:

The postMessage call runs into an error with Windows, as the rich text body is shaped as if there exists an emoji with the name 'woman-tipping-hand::skin-tone-3', when in reality it should be an emoji with the name 'woman-tipping-hand' with the proper unicode to tag its skintone color.

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch
Copy link
Member

seratch commented Jan 6, 2025

Hi @dianexjeong, thank you so much for taking the time to write this detailed report!

It seems this issue is not specific to this Node SDK, so we, as the maintainers of these client-side SDKs, are unable to resolve it. If you don't mind, could you please share this issue URL with our customer support team? They can escalate the issue to the relevant engineering teams. You can submit an inquiry through /feedback in your corporate Slack workspace or at https://my.slack.com/help/requests/new. We would appreciate your understanding.

@dianexjeong
Copy link
Author

Sure thing! @seratch Thank you for the info 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants