`SlackListsItem FieldMessage.message` type does not match API response shape
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api
Research direction
Start in packages/web-api/src/types/request/slackLists.ts and compare SlackListsItemFieldMessage with the response shapes described in the issue and the Slack API field-types documentation. Done means the TypeScript definition accurately represents message as either a message object or an array of message objects, including the fields shown.
Written by the indexing model from the issue text.
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
- slackapi/java-slack-sdk#1587
- https://docs.slack.dev/reference/methods/slackLists.items.create#field-types
Expected Result
N/A
Actual Result
N/A
- Dominant language
- TypeScript
- Stars
- 3.4k
- Forks
- 688
- Avg merge
- 15h 31m
- Merged PRs (30d)
- 27
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.
More from slackapi/node-slack-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
slackapi/node-slack-sdk#2743 · 1 comment ·
-
auto-triage-skip enhancement pkg:web-api
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
slackapi/node-slack-sdk#2607 · 2 comments · 2 reactions ·
-
area:typescript auto-triage-skip bug pkg:web-api
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
slackapi/node-slack-sdk#2459 · 2 comments ·
-
auto-triage-skip bug pkg:web-api semver:patch
Difficulty 3/5 1-2 days Newbie friendliness 72/100
slackapi/node-slack-sdk#2738 · 1 comment ·
-
server-side-issue
Difficulty 4/5 3-5 days Newbie friendliness 38/100
slackapi/node-slack-sdk#2687 · 2 comments ·
All issues in slackapi/node-slack-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·