elixir-grpc / grpc-reflection

elixir graph reflection support
Apache License 2.0
9 stars 6 forks source link

Chore/reproduce package problem #34

Closed mjheilmann closed 2 months ago

mjheilmann commented 3 months ago

When we have nested message definitions, grpcurl is unable to resolve some symbols. I have found that by injecting a different package name it will resolve fine, so there may be an issue in how we calculate the package names of modules.

This PR demonstrates this in the example app.

  1. regenerate the example protos ./generate_protos.sh
  2. run the example app iex -S mix
  3. some messages resolve
    ❯ grpcurl -plaintext 127.0.0.1:50051 describe example.helloworld.HelloSpec     
    example.helloworld.HelloSpec is a message:
    message HelloSpec {
      string message = 1;
      .example.helloworld.HelloSpec.Spec spec = 2;
      message Spec {
        int32 major = 1;
        int32 minor = 2;
        int32 patch = 3;
        string notes = 4;
      }
    }
  4. nested message does not resolve (when you comment out the package overwrite code in server.ex)
    ❯ grpcurl -plaintext 127.0.0.1:50051 describe example.helloworld.HelloSpec.Spec
    Failed to resolve symbol "example.helloworld.HelloSpec.Spec": Symbol not found: example.helloworld.HelloSpec.Spec

This may be related to https://github.com/elixir-grpc/grpc-reflection/issues/20

mjheilmann commented 2 months ago

this PR is not needed