Skip to content

test: probe ListRecord.Field message wire shape against live API (experimental) - #1644

Draft
zimeg wants to merge 2 commits into
apifrom
exp/lists-message-array-proof
Draft

test: probe ListRecord.Field message wire shape against live API (experimental)#1644
zimeg wants to merge 2 commits into
apifrom
exp/lists-message-array-proof

Conversation

@zimeg

@zimeg zimeg commented Sep 10, 2026

Copy link
Copy Markdown
Member

Warning

Experimental / not for merge. This is a throwaway probe used to observe the real production response shape of the Slack Lists message field before committing to a fix for #1587. Expected to be reverted.

This pull request adds an experimental remote-API test that empirically observes how the Slack API returns a list item's message field.

  • Motivation: ListRecord.Field.message` deserialization fails when Slack returns an array #1587 reports that ListRecord.Field.message can come back as an array of message objects, which the production Gson path fails to deserialize (JsonSyntaxException: Expected BEGIN_OBJECT but was BEGIN_ARRAY). The public docs for slackLists.items.create show only the request shape (an array of permalink URL strings) and give no response example, so the response shape is unverified in public.
  • Adds messageFieldArrayShapeProbe to slacklists_Test: creates a list with a message-type column, sets the field with a real message permalink, reads the item back, and:
    1. captures the raw slackLists.items.info JSON and asserts whether the message value is a JSON array ([) or object ({);
    2. separately probes whether the typed (production Gson) deserialization throws on that real shape.
  • Additive, test-only. No SDK source changes.

Category

  • slack-api-client (Slack API Clients)

Testing

Run only the Slack Lists remote test against a workspace with a bot token that has lists:read/lists:write and can post to the test channel:

mvn test -pl slack-api-client -Dtest="test_with_remote_apis.methods.slacklists_Test#messageFieldArrayShapeProbe" -DfailIfNoTests=false

Inspect the [probe] log lines — the SUMMARY line reports messageIsArray, messageIsObject, and typedDeserializationThrew for the live response.

Requirements

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

zimeg and others added 2 commits September 10, 2026 12:17
Adds an experimental remote-API test (messageFieldArrayShapeProbe) to
slacklists_Test that creates a list with a message-type column, sets the
field with a real message permalink, then reads the item back and observes
the actual response shape of the `message` field.

It captures the raw items.info JSON to assert whether `message` is a JSON
array or object, and separately probes whether the typed (production Gson)
deserialization throws on that real shape. Additive, test-only; no SDK
source changes.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Emit a stdout marker with the observed message-field shape and targets the
record.fields[...] message key specifically. Verified against the live API:
the message field is returned as a JSON array and the production Gson path
throws (Expected BEGIN_OBJECT but was BEGIN_ARRAY).

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

zimeg commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

Ran the probe against a live workspace (single scoped test, no manifest/audit tests). Empirical result:

>>>PROBE>>> messagePresent=true messageIsArray=true messageIsObject=false firstValueChar=[
            typedDeserializationThrew=true
            typedError=JsonSyntaxException: Expected BEGIN_OBJECT but was BEGIN_ARRAY
              at ... path $.record.fields[0].message

Two confirmations from the live slackLists.items.info response:

  1. The message field is returned as a JSON array (the raw value begins with [).
  2. The production Gson path throws Expected BEGIN_OBJECT but was BEGIN_ARRAY at $.record.fields[0].message — i.e. ListRecord.Field.message` deserialization fails when Slack returns an array #1587 reproduces against production on the current api branch. The array-handling adapter added in fix(model): handle array format for ListRecord.Field message deserial… #1590 lives only in the test tree and is not registered in the shipped GsonFactory, so real deserialization still fails.

This validates the direction: the fix must register the ListRecord.Field message adapter (or equivalent array-aware deserialization) in the production GsonFactory, and the sample/response typing should be array-capable. This PR itself is throwaway — proof only.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.61%. Comparing base (2bc6aff) to head (3a557ba).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                api    #1644      +/-   ##
============================================
- Coverage     72.66%   72.61%   -0.06%     
+ Complexity     4554     4533      -21     
============================================
  Files           484      483       -1     
  Lines         14493    14460      -33     
  Branches       1521     1520       -1     
============================================
- Hits          10532    10500      -32     
  Misses         3065     3065              
+ Partials        896      895       -1     
Flag Coverage Δ
jdk-14 72.61% <ø> (-0.06%) ⬇️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant