-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalStateException when deserializing message using conversation.history #1426
Comments
Hi @rasharab, thanks for taking the time to report this issue and we're sorry for the disruption. We will look into it early next weeek. |
Thanks. We've hit another different exception as well in a different payload for another customer. This is at another point in the payload body: Got an exception while calling conversations.history API (team: ***, error: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 93854 path $.messages[142].attachments[0].files[0].shares.public.[0].reply_users See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure) j.l.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 93854 path $.messages[142].attachments[0].files[0].shares.public.[0].reply_users See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure at c.g.g.s.JsonReader.unexpectedTokenError(JsonReader.java:1768) at c.g.g.s.JsonReader.beginArray(JsonReader.java:430) at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81) at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:59) at c.g.g.i.b.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:267) at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:558) at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:516) ... 45 common frames omitted Wrapped by: c.g.g.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 93854 path $.messages[142].attachments[0].files[0].shares.public.[0].reply_users See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:520) at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:83) at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:59) at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at c.g.g.i.b.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:200) at c.g.g.i.b.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:154) at c.g.g.i.b.ReflectiveTypeAdapterFactory$2.readIntoField(ReflectiveTypeAdapterFactory.java:267) at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:558) |
…ing conversation.history
@seratch Thank you so much for your fixes. Here's another different one: Got an exception while calling conversations.replies API (team: ***, error: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at path $.file.channels)
|
@rasharab thanks for letting me know this. i will add the same workaround to as many array type properties as possible |
…ing conversation.history
Using conversations.history, we are getting exceptions when the slack sdk attempts to deserialize a customer's message history.
The issue is in the groups field inside the first attachment of the first file in the 169th message of the messages array in the API response is expected to be an array in your sdk but turned out to be an object.
Got an exception while calling conversations.history API (team: ****, error: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 164106 path $.messages[169].attachments[0].files[0].groups See https://github.com/google/gson/blob/main/Troubleshooting.md#unexpected-json-structure)
The text was updated successfully, but these errors were encountered: