Repository navigation
Open
Open
Copy link
Labels
area:typescriptissues that specifically impact using the package from typescript projectsissues that specifically impact using the package from typescript projectsauto-triage-skipbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedpkg:web-apiapplies to `@slack/web-api`applies to `@slack/web-api`
Description
Package
@slack/types
SDK Version
@slack/types 2.21.1
Node.js Version
v24.12.0
Operating System
No response
Steps to Reproduce
SlackListsItemFieldMessage in packages/web-api/src/types/request/slackLists.ts defines:
export interface SlackListsItemFieldMessage {
column_id: string;
message: string[];
}The Slack API can return the message field as either:
- A single message object:
"message": {"text":"hello", "ts": "123.456"} - An array of message objects:
"message":[{"text": "a"}, {"text":"b"}]
The current typing is inaccurate in two ways:
- It assumes
messageis always an array, but the API may return a single object - It types elements as
stringwhen they areactually message objects
See java-slack-sdk#1587 for the same API inconsistency on the Java side.
Suggested fix
interface SlackListsItemMessage {
text?: string;
ts?: string;
user?: string;
team?: string;
type?: string;
}
export interface SlackListsItemFieldMessage {
column_id: string;
message: SlackListsItemMessage | SlackListsItemMessage[];
}
export interface SlackListsItemFieldMessage {
column_id: string;
message: SlackListsItemMessage | SlackListsItemMessage[];
}This types it as a union so consumers handle both shapes.
Impact
No runtime crash (JavaScript is untyped at runtime), but developers relying on the type will write incorrect code, like calling .map() on a non-array or treating objects as strings.
References
- ListRecord.Field.message` deserialization fails when Slack returns an array java-slack-sdk#1587
- https://docs.slack.dev/reference/methods/slackLists.items.create#field-types
Expected Result
N/A
Actual Result
N/A
Metadata
Metadata
Assignees
Labels
area:typescriptissues that specifically impact using the package from typescript projectsissues that specifically impact using the package from typescript projectsauto-triage-skipbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedpkg:web-apiapplies to `@slack/web-api`applies to `@slack/web-api`
Activity
zimeg commentedon Jun 30, 2026
Reopening: the fix for this (#2627) is being reverted in #2640.
#2627 corrected the response shape but did so by retyping the shared
SlackListsItemFieldMessage.messagefield, which also backs request input (initial_fields/cells). That broke request typing —slackLists.items.create/updatemessagetakes an array of message permalink URL strings, not message objects. Since #2627 is still unreleased, #2640 reverts it to restore correct request typing before it ships.This issue (the response
messageshape not matching the API) remains valid and will be handled in a follow-up. The correct fix is to split request vs. response field types — likely via codegen — so the request side keepsstring[]and the response side gets the message-object union, without one direction's fix breaking the other.github-actions commentedon Aug 3, 2026
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
test: populate Slack Lists message field in generated samples