revert(web-api): keep string[] for slack lists message field request input#2640
Conversation
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>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@mwbrooks LGTM! I appreciate the review! |
Summary
This pull request reverts #2627, restoring the Slack Lists item
messagefield tostring[]for request input.SlackListsItemFieldMessage.messagefromstring[]toSlackListsItemMessage | SlackListsItemMessage[]to correct the response shape.SlackListsItemsCreateArguments.initial_fieldsandSlackListsItemCellUpdate/cells), so it broke request typing.slackLists.items.create/updatemessagetakes an array of message permalink URL strings, e.g.{ "column_id": "Col123", "message": ["https://team.slack.com/archives/C123/p1234567890123456"] }.@slack/web-api7.16.0, 7.17.0, and 8.0.0-rc.1 all still shipmessage: string[]— so this reverts the regression before it reaches a release. Its pending changeset is removed and no new changeset is added (the change nets to zero against the last release).SlackListsItem FieldMessage.messagetype does not match API response shape #2598) is intentionally deferred to codegen, which will generate per-direction request/response types and prevent this class of drift. Supersedes the still-open duplicate PRs fix(web-api): widen Slack Lists message field type #2599, Fix Slack Lists message field response types #2600, and fix(web-api): type Slack Lists message fieldFix Slack Lists message field response type responses #2621.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:
U…)https://<team>.slack.com/archives/<C…>/p…)With a token that has the
lists:writescope, the docs-correct request shape is accepted by the API: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:
Observed: the correct string-array call succeeds, while the object-shape call is rejected by the API:
This confirms the object
messageshape #2627 typed for requests is invalid against the API; only thestring[]permalink form is accepted.Requirements