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

RPC: allow null serviceImpl in BindService #361

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

bangfalse
Copy link
Contributor

For instance, using MapGrpcService from Grpc.AspNetCore.Server invokes this method with a null serviceImpl.

For instance, using `MapGrpcService` from `Grpc.AspNetCore.Server` invokes this method with a `null` serviceImpl.
@jamescourtney
Copy link
Owner

Thanks for your contribution! I will review in the next couple of days and likely approve. This looks like an easy one :)

@codecov
Copy link

codecov bot commented Jan 20, 2023

Codecov Report

Merging #361 (8253098) into main (72a0ecf) will increase coverage by 0.31%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #361      +/-   ##
==========================================
+ Coverage   96.15%   96.46%   +0.31%     
==========================================
  Files         115      114       -1     
  Lines        8742     8691      -51     
  Branches      815      812       -3     
==========================================
- Hits         8406     8384      -22     
+ Misses        230      202      -28     
+ Partials      106      105       -1     
Impacted Files Coverage Δ
...harp.Compiler/SchemaModel/RpcServiceSchemaModel.cs 98.97% <100.00%> (+0.01%) ⬆️
src/FlatSharp.Runtime/SpanComparers.cs 84.09% <0.00%> (-2.28%) ⬇️
src/FlatSharp.Runtime/IO/SpanWriterExtensions.cs 100.00% <0.00%> (ø)
src/FlatSharp.UnityPolyfills/NativeArray.cs
...atSharp/Serialization/RoslynSerializerGenerator.cs 98.33% <0.00%> (+0.18%) ⬆️
...peModel/Vectors/UnityNativeArrayVectorTypeModel.cs 98.63% <0.00%> (+16.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72a0ecf...8253098. Read the comment docs.

When enabling nullable reference types on generated code, CS8604 is raised in these generated methods.

Unfortunately, `Grpc.Core.Api` declares these binder method parameters as non-nullable, but then `Grpc.AspNetCore.Server` invokes `BindService` using reflection, passing a null service implementation.
@jamescourtney
Copy link
Owner

This looks good. Thank you for your contribution!

If you're up for it, it would be really great to get some gRPC tests that actually use ASP.NET / Kestrel instead of the old-style ones I have now that use the (deprecated) Google gRPC libraries.

@jamescourtney jamescourtney merged commit 2515d92 into jamescourtney:main Jan 25, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants