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

Correct types #57

Merged
merged 2 commits into from
Nov 11, 2023
Merged

Correct types #57

merged 2 commits into from
Nov 11, 2023

Conversation

sebastiw
Copy link
Contributor

grpc status and status message could be undefined as defined in grpcbox_client_stream. The status will also always be a binary and not an integer as far as I can see.

for example here

on_receive_headers(H, State=#{resp_headers := _,
                              ctx := Ctx,
                              stream_id := StreamId,
                              client_pid := Pid}) ->
    Status = proplists:get_value(<<"grpc-status">>, H, undefined),
    Message = proplists:get_value(<<"grpc-message">>, H, undefined),
    Metadata = grpcbox_utils:headers_to_metadata(H),
    Pid ! {trailers, StreamId, {Status, Message, Metadata}},
    Ctx1 = ctx:with_value(Ctx, grpc_client_status, grpcbox_utils:status_to_string(Status)),
    {ok, State#{ctx => Ctx1,
                resp_trailers => H}};

@codecov
Copy link

codecov bot commented Oct 13, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e04193d) 39.53% compared to head (cfa8a80) 39.53%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #57   +/-   ##
=======================================
  Coverage   39.53%   39.53%           
=======================================
  Files          28       28           
  Lines        2122     2122           
=======================================
  Hits          839      839           
  Misses       1283     1283           
Files Coverage Δ
src/grpcbox_stream.erl 64.61% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tsloughter tsloughter merged commit 1d044a3 into tsloughter:main Nov 11, 2023
6 checks passed
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.

2 participants