You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bot cannot parse one of the update messages and fails with:
[info] No usable value for id
[info] Did not find value which can be converted into long
[info] at org.json4s.reflect.package$.fail(package.scala:95)
[info] at org.json4s.Extraction$ClassInstanceBuilder.org$json4s$Extraction$ClassInstanceBuilder$$buildCtorArg(Extraction.scala:526)
[info] at org.json4s.Extraction$ClassInstanceBuilder$$anonfun$15.apply(Extraction.scala:546)
[info] at org.json4s.Extraction$ClassInstanceBuilder$$anonfun$15.apply(Extraction.scala:546)
[info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
[info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
[info] at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
[info] at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
[info] at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
[info] at scala.collection.AbstractTraversable.map(Traversable.scala:104)
[info] Caused by: org.json4s.package$MappingException: No usable value for id
[info] Did not find value which can be converted into long
[info] at org.json4s.reflect.package$.fail(package.scala:95)
[info] at org.json4s.Extraction$ClassInstanceBuilder.org$json4s$Extraction$ClassInstanceBuilder$$buildCtorArg(Extraction.scala:526)
[info] at org.json4s.Extraction$ClassInstanceBuilder$$anonfun$15.apply(Extraction.scala:546)
[info] at org.json4s.Extraction$ClassInstanceBuilder$$anonfun$15.apply(Extraction.scala:546)
[info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
[info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
[info] at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
[info] at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
[info] at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
[info] at scala.collection.AbstractTraversable.map(Traversable.scala:104)
[info] Caused by: org.json4s.package$MappingException: Did not find value which can be converted into long
[info] at org.json4s.reflect.package$.fail(package.scala:95)
[info] at org.json4s.Extraction$$anonfun$org$json4s$Extraction$$convert$2.apply(Extraction.scala:704)
[info] at org.json4s.Extraction$$anonfun$org$json4s$Extraction$$convert$2.apply(Extraction.scala:704)
[info] at scala.Option.getOrElse(Option.scala:121)
[info] at org.json4s.Extraction$.org$json4s$Extraction$$convert(Extraction.scala:704)
[info] at org.json4s.Extraction$$anonfun$extract$6.apply(Extraction.scala:394)
[info] at org.json4s.Extraction$$anonfun$extract$6.apply(Extraction.scala:392)
[info] at org.json4s.Extraction$.customOrElse(Extraction.scala:606)
[info] at org.json4s.Extraction$.extract(Extraction.scala:392)
[info] at org.json4s.Extraction$ClassInstanceBuilder.org$json4s$Extraction$ClassInstanceBuilder$$buildCtorArg(Extraction.scala:514)
Telegram4s v3.0.9
The text was updated successfully, but these errors were encountered:
Got it, thanks for reporting!
I pushed a fix (786ef9c) to v3.0.13, which is also updated to the latest Telegram Bot API (v3.4).
Overview
Just a de-serialization issue; these are easy to fix, but hard to find.
I'll look some property-based testing library so I can fuzz the (de)serialization routines.
Issue
Some fields (Message.migratetoChatId) were typed ChatId.Chat, serialization was covered for the super type ChatId but not for ChatId.Chat.
Fix
Replace ChatId.Chat by Long. This is the least-resistance solution. Also considered adding yet another custom serializer for ChatId.Chat.
Compatibility issues
This change should be transparent for most users, except for a few methods that expect Option[ChatId].
e.g.
Steps to reproduce:
Expected behavior:
Bot will correctly handle all these events
Actual behavior:
Bot cannot parse one of the update messages and fails with:
Telegram4s v3.0.9
The text was updated successfully, but these errors were encountered: