Skip to content

feat: add webapi response changes as of 2026-08-22 - #1636

Open
slackapi[bot] wants to merge 19 commits into
mainfrom
api
Open

feat: add webapi response changes as of 2026-08-22#1636
slackapi[bot] wants to merge 19 commits into
mainfrom
api

Conversation

@slackapi

@slackapi slackapi Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This PR updates the web API client and model based on the production E2E test results.

Category

  • slack-api-model (Slack API Data Models)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

@slackapi
slackapi Bot requested a review from a team as a code owner August 22, 2026 00:54
@slackapi slackapi Bot added project:slack-api-model project:slack-api-model semver:patch labels Aug 22, 2026
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.88%. Comparing base (b7562e3) to head (6da7f84).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1636   +/-   ##
=========================================
  Coverage     72.87%   72.88%           
- Complexity     4522     4523    +1     
=========================================
  Files           479      479           
  Lines         14390    14390           
  Branches       1503     1503           
=========================================
+ Hits          10487    10488    +1     
+ Misses         3013     3012    -1     
  Partials        890      890           
Flag Coverage Δ
jdk-14 72.88% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

zimeg and others added 8 commits August 24, 2026 13:51
Detected by the runner's audit-log test (getActions_detectingNewOnes)
as an unknown App action returned by the live audit API.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The live audit API returns this action under getUser(), not getApp()
(confirmed by a local task test:audit run). a205d62 declared it in
Actions.App, so getActions_detectingNewOnes still failed on the User
loop. Move it to the correct bucket.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The sample-JSON masker blanks the Lists item `message` field to `[""]`
because the live value is often empty, which makes downstream type
generation infer `string[]` instead of the message-object shape the API
actually returns. Add a path-gated (`/api/slackLists.`) branch that
injects a populated Message, so the sample reflects the real object shape.

Fixes the sample side of slackapi/node-slack-sdk#2598 (wrong TS response
type). Separate from java-slack-sdk#1587, the already-fixed runtime
deserialization crash.

❤️
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The Lists item `message` field response is an array of message references,
verified against the live API on two surfaces (slackLists.items.list and the
conversations.replies/history nested list_record path): both return
List<{value, channel_id, ts, thread_ts?}>, always an array, with thread_ts
present only for threaded-reply references. No single-object form was
observed on either endpoint.

This replaces the earlier `Message`-typed modeling (#1590), whose element
type (a full chat Message) does not match the actual payload, and whose
single-object/array normalization handled a shape the API does not return.
The custom test deserializer is reduced to a pass-through and its tests are
rewritten against the verified MessageRef shape.

EXPERIMENTAL / not final: this fixes the RESPONSE shape only. The request
side of the field takes an array of permalink URL strings (List<String>),
which this single type does not model — the request/response split still
needs a design decision (see the PR discussion). Marking experimental so it
is reviewed, not merged as-is.

❤️
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg

zimeg commented Aug 25, 2026

Copy link
Copy Markdown
Member

⚠️ EXPERIMENTAL — Slack Lists message field re-typed as List<MessageRef> (388afd370)

Pushed an experimental change to how ListRecord.Field.message is modeled. Not final — do not merge as-is. Flagging it here with full context for review.

What changed

ListRecord.Field.message is now List<ListRecord.MessageRef> where MessageRef = { value, channel_id, ts, thread_ts? }. The prior Message-typed modeling (#1590) is replaced; the test-tree GsonListRecordFieldFactory is reduced to a pass-through and its tests rewritten against the new shape.

Why — verified against the live API

The response shape was confirmed empirically on two surfaces, across single/threaded/multi-reference scenarios:

Both return the message field as [{ "value": "<permalink>", "channel_id": "C…", "ts": "…", "thread_ts"?: "…" }]always an array, with thread_ts present only when the referenced message is a threaded reply. No single-object form was observed on either endpoint. Element is a message reference, not a chat message. Field-type reference: slackLists.items.create#field-types.

This means the earlier Message element type did not match the payload, and the single-object↔array normalization added in #1590 handled a shape the API does not actually return on these endpoints.

Open question (the reason this is experimental)

This fixes the response only. The request side of the field takes an array of permalink URL strings (List<String>) — verified: the API rejects object form with must provide a string [json-pointer:/initial_fields/0/message/0]. A single Field.message type cannot serve both directions. The request/response split still needs a design decision (direction-aware types, or bring Lists types under codegen). This is the same request-vs-response tension previously seen on the Node side.

Related / for later reference

  • #1590 — the earlier Java array-deserialization fix (runtime crash) that this supersedes on the model side.
  • java-slack-sdk ListRecord.Field.message` deserialization fails when Slack returns an array #1587 — the runtime JsonSyntaxException on array-shaped message; fixed (that was a crash; distinct from this typing question).
  • node-slack-sdk #2598 — the analogous Node bug: the generated response type is wrong for this field. This model fix is the upstream half of resolving it (Node response types generate from Java samples).
  • node-slack-sdk #2599 / #2600 — hand-split attempts at #2598 that modeled Message | Message[]; obsolete — they used the wrong element type and an unnecessary union (the field is array-only, and the element is a reference, not a Message).

Verification was done against a test workspace; a few throwaway probe lists (clack probe …) were created there and can be cleaned up.

zimeg and others added 10 commits August 25, 2026 08:43
With ListRecord.Field.message typed as List<MessageRef>, the message field
needs no custom normalization — default Gson deserialization is correct — so
the adapter had been reduced to a pass-through. Delete it and drop its
registration in the test GsonFactory. ListRecordFieldTest still passes.

❤️
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…age field + remote test coverage

Adds a Gson adapter so a single List<MessageRef> models the asymmetric Lists
message field correctly in both directions (verified against the live API):
- request: serializes each MessageRef to its `value` -> message: ["<permalink>"]
  (the API rejects object form: "must provide a string")
- response: deserializes {value, channel_id, ts, thread_ts?} objects (and
  tolerates bare-string elements defensively)

Registers the adapter in both the main and test GsonFactory. Extends the
remote slacklists_Test to add a message column, post a message, reference it
by permalink, and assert the echoed reference shape — so the generated sample
carries the real message field instead of a degenerate [""]. The live remote
test passes (3/3) and the raw capture shows the correct
{value, channel_id, ts} shape.

Still EXPERIMENTAL / not final (see PR discussion): this is the response/
request modeling for the message field via one type; review before merge. The
committed sample is regenerated by the runner from this capture.

Fixes the Java half of node-slack-sdk#2598 (node response types generate from
these Java samples). Supersedes the Message-typed modeling from #1590 for this
field.

❤️
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…sts message field + remote test coverage"

This reverts commit 2787334.
An ad-hoc runner run merged a full rich Message object into the
response_metadata.messages field of every slackLists.* sample (~516 lines
each: attachments, bot_profile, wibblr, nested recursion). That field on a
slackLists response carries warning strings, not a chat message — the content
is bogus and broke PR #1636's diff. Restore all 10 slackLists samples to their
main-branch state (clean, empty response_metadata.messages).

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant