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

Server code generated by RouterUsingActions does not compile #292

Closed
drZoid opened this issue Aug 31, 2020 · 3 comments
Closed

Server code generated by RouterUsingActions does not compile #292

drZoid opened this issue Aug 31, 2020 · 3 comments

Comments

@drZoid
Copy link
Contributor

drZoid commented Aug 31, 2020

Context -
I am trying to generate a play router stub which uses Actions. (as described in this issue akka/akka-grpc#420)

Problem -
The code generated using the twirl template for RouterUsingActions has compile time errors.

/AbstractRouter.scala:22:223: type mismatch;
[error]  found   : PartialFunction[Throwable,akka.grpc.Trailers]
[error]  required: PartialFunction[Throwable,io.grpc.Status]
[error]   abstract class AbstractUserServiceRouter(mat: Materializer, system: ActorSystem, parsers: PlayBodyParsers, actionBuilder: ActionBuilder[Request, AnyContent], eHandler: ActorSystem => PartialFunction[Throwable, Status] = defaultMapper) extends PlayRouterUsingActions(mat, GreeterService.name, parsers, actionBuilder) with GreeterService {

and

/AbstractRouter.scala:31:59: type mismatch;
[error]  found   : akka.actor.ActorSystem => PartialFunction[Throwable,io.grpc.Status]
[error]  required: akka.actor.ActorSystem => PartialFunction[Throwable,akka.grpc.Trailers]
[error]       val handler = GreeterServiceHandler(this, serviceName, eHandler)(mat, system)

Solution
I was able to modify the twirl template to eliminate the compilation errors and was able to use it to serve grpc via play's EssentialActions. The injected Actions and filters are working with this RouterUsingActions.

I've added a pull request that fixes this issue on top of play-grpc version 0.8.2. Apparently fixing this on latest master will take some more effort. It appears to have another issue apart from this one. I am looking into it and will open another pull request against master if I am successful.

@raboof
Copy link
Member

raboof commented Sep 3, 2020

Thanks for testing and fixing this!

Would it be useful to you to do another 0.8.x release with these changes or would it be enough to just do a 0.9.x one from master?

@raboof raboof closed this as completed Sep 3, 2020
@drZoid
Copy link
Contributor Author

drZoid commented Sep 3, 2020

@raboof - Thank you! Another 0.8.x release is what I need to get unblocked at the moment.

@raboof
Copy link
Member

raboof commented Sep 3, 2020

0.8.3 should be on its way to maven central now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants