Skip to content

fix: update SlackListsItemFieldMessage to support single and array message shapes#2627

Merged
srtaalej merged 3 commits into
slackapi:mainfrom
swayamsingh2004:fix/slack-lists-message-type
Jun 16, 2026
Merged

fix: update SlackListsItemFieldMessage to support single and array message shapes#2627
srtaalej merged 3 commits into
slackapi:mainfrom
swayamsingh2004:fix/slack-lists-message-type

Conversation

@swayamsingh2004

Copy link
Copy Markdown
Contributor

Fixes #2598

Problem

SlackListsItemFieldMessage typed the message field as string[], which was incorrect in two ways:

  1. The Slack API can return message as either a single object or an array of objects
  2. The elements are message objects (with text, ts, etc.), not strings

Solution

  • Added a new SlackListsItemMessage interface with optional fields: text, ts, user, team, type
  • Changed message: string[] to message: SlackListsItemMessage | SlackListsItemMessage[] to handle both shapes the API can return

References

@swayamsingh2004 swayamsingh2004 requested a review from a team as a code owner June 14, 2026 21:22
@changeset-bot

changeset-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9df488e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/web-api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @swayamsingh2004 to sign the Salesforce Inc. Contributor License Agreement.

@srtaalej

Copy link
Copy Markdown
Contributor

hi @swayamsingh2004 thank you for taking the time to fix this issue! I will take a look at the code and make sure its all correct for merge 💟

Updated SlackListsItemFieldMessage to handle both single and array message shapes.
@srtaalej srtaalej added the bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented label Jun 16, 2026

@srtaalej srtaalej left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and working well ⭐ ⭐ ⭐

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.88%. Comparing base (66e6cdb) to head (9df488e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2627   +/-   ##
=======================================
  Coverage   88.88%   88.88%           
=======================================
  Files          62       62           
  Lines       10238    10238           
  Branches      451      451           
=======================================
  Hits         9100     9100           
  Misses       1117     1117           
  Partials       21       21           
Flag Coverage Δ
cli-hooks 88.88% <ø> (ø)
cli-test 88.88% <ø> (ø)
logger 88.88% <ø> (ø)
oauth 88.88% <ø> (ø)
socket-mode 88.88% <ø> (ø)
web-api 88.88% <ø> (ø)
webhook 88.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@srtaalej

Copy link
Copy Markdown
Contributor

Related issues across SDKs

This is the same underlying API inconsistency that was reported and fixed in the Java SDK:

@srtaalej srtaalej merged commit 59a6329 into slackapi:main Jun 16, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented cla:signed semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SlackListsItem FieldMessage.message type does not match API response shape

2 participants