Skip to content

revert(web-api): keep string[] for slack lists message field request input#2640

Merged
zimeg merged 1 commit into
mainfrom
fix/lists-message-request-type
Jun 30, 2026
Merged

revert(web-api): keep string[] for slack lists message field request input#2640
zimeg merged 1 commit into
mainfrom
fix/lists-message-request-type

Conversation

@zimeg

@zimeg zimeg commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

This pull request reverts #2627, restoring the Slack Lists item message field to string[] for request input.

Note

This is a revert to stop the unreleased request-side regression. It does not fix the original response-shape issue (#2598), which is being reopened and will be addressed in a follow-up — the correct fix is to split request vs. response field types (e.g. via codegen) so both directions are typed correctly.

Testing

Gather these before running — both must come from your own workspace:

  • a user ID to grant list access to (U…)
  • a real message permalink (https://<team>.slack.com/archives/<C…>/p…)

With a token that has the lists:write scope, the docs-correct request shape is accepted by the API:

// Create a list with a message column.
const { list_id, list_metadata } = await client.slackLists.create({
  name: 'Message field probe',
  schema: [
    { key: 'title', name: 'Title', type: 'text', is_primary_column: true },
    { key: 'message_link', name: 'Message', type: 'message' },
  ],
});
const messageColumn = list_metadata.schema.find((c) => c.key === 'message_link');

// Grant a teammate write access (replace with a real user ID).
await client.slackLists.access.set({
  list_id,
  access_level: 'write',
  user_ids: ['U00000000'], // <-- gather before run
});

// Correct: `message` is an array of permalink URL strings — the API accepts this.
await client.slackLists.items.create({
  list_id,
  initial_fields: [
    {
      column_id: messageColumn.id,
      message: ['https://yourteam.slack.com/archives/C00000000/p0000000000000000'], // <-- gather before run
    },
  ],
});

To confirm the object shape #2627 allowed is invalid on the request side, send it untyped (the reverted types correctly reject it at compile time) and observe the API reject it too:

// Broken: `message` as a message object. Sent via apiCall to reach the API at runtime.
await client.apiCall('slackLists.items.create', {
  list_id,
  initial_fields: [
    { column_id: messageColumn.id, message: { text: 'message objects are response-only' } },
  ],
});

Observed: the correct string-array call succeeds, while the object-shape call is rejected by the API:

[ERROR]  bolt-app An API error occurred: internal_error
    at platformErrorFromResult (.../node_modules/@slack/web-api/dist/errors.js:67:33)
    at WebClient.apiCall (.../node_modules/@slack/web-api/dist/WebClient.js:232:56)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async path/to/app.js:62:5 {
  code: 'slack_webapi_platform_error',
  data: {
    ok: false,
    error: 'internal_error',
    response_metadata: { scopes: [Array], acceptedScopes: [Array] }
  }
}

This confirms the object message shape #2627 typed for requests is invalid against the API; only the string[] permalink form is accepted.

Requirements

Reverts #2627. That change retyped the shared SlackListsItemFieldMessage
"message" field from string[] to a message-object union to fix the response
shape, but the same type backs request input (initial_fields / cells), so it
broke request typing. Per the docs, slackLists.items.create/update "message"
takes an array of message permalink URL strings.

#2627 is unreleased (7.16.0, 7.17.0, 8.0.0-rc.1 all still ship string[]), so
this lands before the regression reaches a release. The response-side object
shape is deferred to codegen, which will generate per-direction types.

Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bb390aa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.90%. Comparing base (07744de) to head (bb390aa).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2640   +/-   ##
=======================================
  Coverage   88.90%   88.90%           
=======================================
  Files          63       63           
  Lines       10256    10256           
  Branches      452      452           
=======================================
  Hits         9118     9118           
  Misses       1117     1117           
  Partials       21       21           
Flag Coverage Δ
cli-hooks 88.90% <ø> (ø)
cli-test 88.90% <ø> (ø)
logger 88.90% <ø> (ø)
oauth 88.90% <ø> (ø)
socket-mode 88.90% <ø> (ø)
web-api 88.90% <ø> (ø)
webhook 88.90% <ø> (ø)

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.

@zimeg zimeg added pkg:web-api applies to `@slack/web-api` area:typescript issues that specifically impact using the package from typescript projects semver:patch bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented labels Jun 30, 2026
@zimeg zimeg self-assigned this Jun 30, 2026
@zimeg zimeg modified the milestones: web-api@7.x, web-api@next Jun 30, 2026
@zimeg zimeg changed the title revert: Slack Lists message field back to string[] for request input revert(web-api): keep string[] for slack lists message field request input Jun 30, 2026
@zimeg zimeg marked this pull request as ready for review June 30, 2026 07:21
@zimeg zimeg requested a review from a team as a code owner June 30, 2026 07:21
@zimeg

zimeg commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

@mwbrooks LGTM! I appreciate the review!

@zimeg zimeg merged commit 9db85aa into main Jun 30, 2026
14 checks passed
@zimeg zimeg deleted the fix/lists-message-request-type branch June 30, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:typescript issues that specifically impact using the package from typescript projects bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:web-api applies to `@slack/web-api` semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants