Repository navigation
Conversation
|
Thanks for the contribution! Before we can merge this, we need @bkyryliuk to sign the Salesforce Inc. Contributor License Agreement. |
0143fec to
c4e886a
Compare
c4e886a to
794d93e
Compare
slackapi#1590 added GsonListRecordFieldFactory to handle array-shaped list_record field messages, but only under slack-api-model tests. The production GsonFactory never registered it, so conversations.replies still fails with Expected BEGIN_OBJECT but was BEGIN_ARRAY on Slack List unfurls (slackapi#1587, slackapi#1653, reproduced in slackapi#1644). Move the factory to slack-api-model main next to the other model adapters and register it in GsonFactory.registerTypeAdapters.
794d93e to
9bea9ac
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1654 +/- ##
============================================
- Coverage 72.90% 72.89% -0.01%
- Complexity 4593 4599 +6
============================================
Files 483 484 +1
Lines 14565 14590 +25
Branches 1520 1524 +4
============================================
+ Hits 10618 10635 +17
- Misses 3044 3050 +6
- Partials 903 905 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
thanks @bkyryliuk, and thanks for tracking down why #1590 didn't fix this in production. you're right that the adapter only ever ran in the test we're going to close this one in favor of #1637, though. Our live API probes (#1644, #1637) found that message on list fields is always an array, and that each element is a message reference shaped like your test is really useful, though! It parses |
Addresses #1653 (follow-up to #1587).
#1590 added
GsonListRecordFieldFactoryso thatListRecord.Field.messageaccepts the array shape that Slack Lists return. But the factory was only inslack-api-model/src/test, and only the testGsonFactoryregistered it. The productioncom.slack.api.util.json.GsonFactorynever registered it. So on 1.49.0 through 1.52.0,conversations.repliesstill fails on any thread that has a Slack List unfurl:Reported in #1587 (follow-up on 1.50.0) and reproduced against a live workspace in #1644.
This PR:
GsonListRecordFieldFactoryfromslack-api-model/src/test/java/test_locally/util/list/toslack-api-model/src/main/java/com/slack/api/util/json/. This is where the other model adapters live, such asGsonListViewGroupingFactory. The package does not change, so the model testGsonFactorystill compiles.GsonFactory.registerTypeAdaptersforListRecord.Field.GsonListRecordFieldFactoryTestinslack-api-client. It parses aconversations.repliesresponse through the productionGsonFactory, for both the array and the single-objectmessageshapes.There is no API change: this activates the
getMessages()/setMessages()behavior that #1590 already shipped. #1637 (draft,MessageRef) can replace the adapter when it lands.Category (place an
xin each of the[ ])Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.
This pull request and its description were written by Isaac.