Skip to content
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

NumberFormatException when using conversations.history #1397

Closed
rasharab opened this issue Nov 19, 2024 · 2 comments
Closed

NumberFormatException when using conversations.history #1397

rasharab opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented java This is a label that @dependabot automatically creates. We don't use it. project:slack-api-client project:slack-api-client project:slack-api-model project:slack-api-model
Milestone

Comments

@rasharab
Copy link

rasharab commented Nov 19, 2024

We are hitting this error when calling conversations.history
Not sure how video_html_height is a double, but your sdk treats it as an Integer.
This looks more like a server side bug but you guys would know better who to reach out to...

Got an exception while calling conversations.history API (team: ******, error: java.lang.NumberFormatException: Expected an int but was 266.38917793965 at line 1 column 51910 path $.messages[113].attachments[0].video_html_height)

 j.l.NumberFormatException: Expected an int but was 266.38917793965 at line 1 column 51910 path $.messages[113].attachments[0].video_html_height
	at c.g.g.s.JsonReader.nextInt(JsonReader.java:1218)
	at c.g.g.i.b.TypeAdapters$7.read(TypeAdapters.java:249)
	... 31 common frames omitted
Wrapped by: c.g.g.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 266.38917793965 at line 1 column 51910 path $.messages[113].attachments[0].video_html_height
	at c.g.g.i.b.TypeAdapters$7.read(TypeAdapters.java:251)
	at c.g.g.i.b.TypeAdapters$7.read(TypeAdapters.java:241)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
	at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
	at c.g.g.i.b.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
	at c.g.g.i.b.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
	at c.g.g.i.b.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapte...

The Slack SDK version

1.44.4

@rasharab rasharab changed the title (Set a clear title describing the issue) NumberFormatException when using conversations.history Nov 19, 2024
@vegeris vegeris added java This is a label that @dependabot automatically creates. We don't use it. bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented and removed untriaged labels Nov 19, 2024
@seratch seratch added project:slack-api-client project:slack-api-client project:slack-api-model project:slack-api-model labels Nov 21, 2024
@seratch seratch added this to the 1.44.2 milestone Nov 21, 2024
@seratch seratch self-assigned this Nov 21, 2024
@seratch
Copy link
Member

seratch commented Nov 21, 2024

Thank you so much for reporting this. It seems the server now returns either double or integer value for the property while it used to consistently return only integer. We will update the type to Double to prevent this runtime error.

@seratch
Copy link
Member

seratch commented Nov 21, 2024

The latest revision resolves this issue. Will release a new patch version shortly.

@seratch seratch closed this as completed Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented java This is a label that @dependabot automatically creates. We don't use it. project:slack-api-client project:slack-api-client project:slack-api-model project:slack-api-model
Projects
None yet
Development

No branches or pull requests

3 participants