scalapb / zio-grpc

ScalaPB meets ZIO: write purely functional gRPC services and clients using ZIO
Apache License 2.0
257 stars 81 forks source link

Add StatusException trailers to response metadata #548

Open Gregory-Berkman-Imprivata opened 10 months ago

Gregory-Berkman-Imprivata commented 10 months ago

Modified test unary request (common) - returns correct error response to check if trailers in the StatusException are propagated from server to client. Modified ListenerDriver.scala to add the trailers from the StatusException to the response metadata

The modified test passed but other tests in MetadataSpec failed for unknown reasons

547

Gregory-Berkman-Imprivata commented 10 months ago

@thesamet I modified a test to check if trailers are propagated from the server to the client. That test passed in my PR but other MetadataSpec tests started failing. I also did not modify any other request type except for unary.

thesamet commented 10 months ago

Looks like the change isn't compatible with Scala 2.12: https://github.com/scalapb/zio-grpc/actions/runs/5943784958/job/16119751686?pr=548#step:7:27

Gregory-Berkman-Imprivata commented 10 months ago

Looks like the change isn't compatible with Scala 2.12: https://github.com/scalapb/zio-grpc/actions/runs/5943784958/job/16119751686?pr=548#step:7:27

I used import scala.jdk.CollectionConverters.CollectionHasAsScala to convert the set of Keys in the metadata to scala Iterable but it has not been introduced in Scala 2.12. Switch to import scala.collection.JavaConverters._ which is deprecated in 2.13