-
Notifications
You must be signed in to change notification settings - Fork 161
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
Protobuf Codec: Fails to decode lists of lists #94
Labels
Comments
thinkharderdev
added
bug
Something isn't working
good first issue
Good for newcomers
labels
Jul 20, 2021
The problem occurs with a single empty list as well: testM("record with array fields") {
val value = WithPiggyback(List(), 0)
encodeAndDecodeNS(Schema[WithPiggyback], value, print = true).map { ed =>
assert(ed)(equalTo(value))
}
}
case class WithPiggyback(
gossip: List[String],
conversationId: Long
) Even without the I tried to decode the field as an |
I'll work on this. |
thinkharderdev
pushed a commit
that referenced
this issue
Oct 26, 2021
landlockedsurfer
pushed a commit
to landlockedsurfer/zio-schema
that referenced
this issue
May 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we fail to decode empty lists of lists. Issue can replicated with the following test case
The issue seems to be in composing
Decoders
whereflatMap
errors out if there are no bytes remaining in the chunk after running the "first" decoder. This causes an issue when the final field in a Record is a collection. In that case, the key will be decoded as a length delimited field with zero length. As expected there are no more bytes to decode since the list is empty but whenflatMap
ing the Decoder will error out.The text was updated successfully, but these errors were encountered: