chat_postMessage inline code block with >4000 symbols broken markdown

Open
#259 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
api

Research direction

Start at the chat_postMessage entry point and reproduce the issue using the two payloads in the report with 4,000 and 4,100 characters. Compare the client request and Slack response to determine whether splitting happens in slack-ruby-client or the Slack API; done means the cause and expected handling are established.

Written by the indexing model from the issue text.

Description

bug?

I'm sending large inline code blocks into our slack rooms and blocks with more than 4000 symbols (roughly) are coming with a broken code style.

This message works fine:

"*test*\n```#{"x"*4000}```\n*test*"

This one came "broken":

"*test*\n```#{"x"*4100}```\n*test*"

It seems that the message is being split into two.
I'm not quite sure whether it's a gem's issue or an API problem.

The doc https://api.slack.com/methods/chat.postMessage#formatting says

For best results, limit the number of characters in the text field to 4,000 characters. Ideally, messages should be short and human-readable. Slack will truncate messages containing more than 40,000 characters.

Messages are not truncated though, just split.
Please guide where to look at.
I'm using v0.14.1 at the moment.

Dominant language
Ruby
Stars
1.3k
Forks
222
Avg merge
1d 14h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from slack-ruby/slack-ruby-client

All issues in slack-ruby/slack-ruby-client

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.