cloudstateio / cloudstate

Distributed State Management for Serverless
https://cloudstate.io
Apache License 2.0
763 stars 97 forks source link

Fix proto descriptor extract service #497

Closed pvlugter closed 3 years ago

pvlugter commented 3 years ago

Resolves #496.

If there are multiple entities registered, which have separate file descriptors but share the same package name, then subsequent services can't be found. The extractService method is used to collect the first matching service. Previously it would filter on the package, and then do a findServiceByName, but this will return a Some(null) on an earlier file descriptor if the service is actually in a later file descriptor. Update to only return Some(serviceDescriptor) if found, otherwise None to continue the search. I'm assuming this was the original intention.

Can follow up with a test...

jroper commented 3 years ago

I think I fixed this in #465.

pvlugter commented 3 years ago

I think I fixed this in #465.

:+1: Ah, didn't think of checking that PR. Yes, fixed in the same way with a flatMap (just unnecessary option allocations).

pvlugter commented 3 years ago

I'm assuming #465 ends up testing this in some way then, if it was uncovered then.