Any type throwing NPE within HttpJson server streaming calls.
The HttpJson server streaming callable causes a NullPointerException (NPE) when processing responses containing Any type values. This is because the TypeRegistry in CallOptions is typically null, which is passed to ProtoMessageResponseParser.parse() within HttpJsonClientCallImpl, resulting in NPE.
For example, Spanner's BatchWriteResponse includes a Status field with an Any type details value. Consequently, when the server returns an error, the response parsing results in NPE.
Please take a look at a concrete example in https://github.com/googleapis/java-spanner/issues/3640 for detailed reproduction steps.
FYI. I created a fix for: https://github.com/googleapis/sdk-platform-java/pull/3640.
This issue was discussed with @blakeli0 in https://github.com/googleapis/java-spanner/issues/3640 regarding:
- this issue not present in other streaming types
- even with the fix,
InvalidProtocolBufferExceptionstill thrown because the defaultTypeRegistrydoesn't include the types forStatus.