slackapi / slackapi/java-slack-sdk

Allow empty text parameter in chatPostMessage when using metadata without warnings

Open
#1,535 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triage-skip discussion enhancement
Dominant language
Java
Stars
602
Forks
232
Avg merge
4d 9h
Merged PRs (30d)
7

Description

When using chatPostMessage API with work objects pattern (metadata-only messages), the SDK generates warning logs requesting text parameter even though the message intentionally contains only metadata. This creates unnecessary noise in application logs.

ctx.client().chatPostMessage { req ->
    req
        .channel(ctx.requestUserId)
        .text("____") // unnecessary
        .metadataAsString(gson.toJson(metaData))
}
Current Behavior

When sending metadata-only messages using the work objects pattern, the SDK generates warnings even though text is intentionally omitted:

ctx.client().chatPostMessage { req ->
    req
        .channel(ctx.requestUserId)
        .metadataAsString(gson.toJson(metaData))
}

This produces warning logs like: "text parameter is missing" or similar, which clutters application logs when this pattern is used frequently.

Expected Behavior

The SDK should either:

  1. Provide an explicit option to suppress text validation warnings when metadata is present
  2. Automatically skip text validation warnings when metadata or metadataAsString is provided
  3. Change the default behavior to not generate warnings for metadata-only messages
Proposed Solution

Add a parameter like suppressTextWarning or automatically detect when metadata is present and skip the text validation warning in that case.

Use Case

Work objects pattern is a valid Slack API pattern where messages contain only metadata for application-to-application communication without user-visible text. Generating warnings for this intentional usage creates log pollution and makes it harder to identify genuine issues.

Category (place an x in each of the [ ])
  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)
Requirements

Please make sure if this topic is specific to this SDK. 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 agree to those rules.

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.

Research direction

Start by locating the chatPostMessage validation and warning logic in the Slack API client or Kotlin extension modules; the issue does not name a file or test. Check how metadata and metadataAsString are handled, then verify that metadata-only messages no longer produce text warnings while messages without metadata retain appropriate validation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.