Skip to content

fix: split Block Kit sections exceeding 3000-char limit#123

Merged
piekstra merged 2 commits intomainfrom
fix/block-splitting-3000-char-limit
Mar 12, 2026
Merged

fix: split Block Kit sections exceeding 3000-char limit#123
piekstra merged 2 commits intomainfrom
fix/block-splitting-3000-char-limit

Conversation

@piekstra
Copy link
Copy Markdown
Collaborator

Summary

  • Split text exceeding Slack's 3000-character section block limit into multiple mrkdwn section blocks, breaking at the last newline before the limit to avoid splitting mid-line
  • Document credential resolution order (env vars take precedence over stored credentials)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING guide
  • My code follows the project's code style
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass (make test)
  • I have updated documentation if needed

Context

Messages over 3000 characters sent via slck messages send caused Slack API invalid_blocks errors because buildDefaultBlocks() created a single section block with all the text. Slack's Block Kit enforces a 3000-character limit per section text field.

The fix splits long text into multiple section blocks, breaking at the last newline before the 3000-char boundary. Existing tests updated to cover the splitting behavior.

Section blocks have a 3000-character text limit. buildDefaultBlocks
was putting the entire message into a single section block, causing
Slack to reject messages exceeding this limit with invalid_blocks.

Split long text across multiple section blocks, breaking at newlines
to avoid splitting mid-line.
GetAPIToken() now checks SLACK_API_TOKEN env var before keychain,
matching GetUserToken() behavior. This allows automation tools to
inject their own tokens via env vars without conflicting with
locally stored keychain credentials.
@piekstra piekstra merged commit c1fff7d into main Mar 12, 2026
2 checks passed
@piekstra piekstra deleted the fix/block-splitting-3000-char-limit branch March 12, 2026 17:21
rianjs added a commit that referenced this pull request Mar 23, 2026
Add missing documentation for emoji list, files download, whoami,
--channel and --file flags on messages send. Add emoji:read and
files:read OAuth scopes to manifest. Update CHANGELOG with entries
for recent features (#120, #122, #123, #125, #126, #130). Add
integration test sections for emoji, files, identity, and --channel.
rianjs added a commit that referenced this pull request Mar 23, 2026
## Summary

- Add missing README sections for `emoji list`, `files download`, and
`whoami` commands
- Document `--channel` and `--file` flags on `messages send`
- Add `emoji:read` and `files:read` OAuth scopes to app manifest and
scopes table
- Add `emoji` → `e` alias to aliases table
- Update CHANGELOG with entries for #120, #122, #123, #125, #126, #130
- Add integration test sections: Part 8 (Emoji & Files), Part 9
(Identity)
- Add `--channel` flag test case to messaging section
- Add `emoji:read` and `files:read` to integration test setup scopes
table

## Test plan

- [x] No code changes — docs only
- [ ] Review README for accuracy against actual CLI behavior
- [ ] Verify CHANGELOG entries reference correct PR numbers
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.

1 participant