slack-ruby / slack-ruby/slack-ruby-client
chat_postMessage inline code block with >4000 symbols broken markdown
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.3k
- Forks
- 222
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100