Skip to content

Commit

Permalink
fix(rpcreplay): properly unmarshal dynamic message (#9774)
Browse files Browse the repository at this point in the history
Fixes: #9773
  • Loading branch information
codyoss authored Apr 15, 2024
1 parent 8892943 commit 53ccb20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rpcreplay/rpcreplay.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,14 +726,18 @@ func readEntry(r io.Reader) (*entry, error) {
var msg message
if pe.Message != nil {
if pe.IsError {
var s *spb.Status
s := &spb.Status{}
err := anypb.UnmarshalTo(pe.Message, s, proto.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true})
if err != nil {
return nil, err
}
msg.err = status.ErrorProto(s)
} else {
msg.msg = pe.Message.ProtoReflect().Interface()
m, err := anypb.UnmarshalNew(pe.Message, proto.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true})
if err != nil {
return nil, err
}
msg.msg = m
}
} else if pe.IsError {
msg.err = io.EOF
Expand Down

0 comments on commit 53ccb20

Please sign in to comment.