Closed jhump closed 6 months ago
@emcfarlane, this fixes a few bugs in Vanguard that were tickled by behavior changes in the newer connect-go.
Akshay already approved, but I wanted you to take a look before I merge.
After this is merged, I will cut a new release of Vanguard. We've got a few other fixes and improvements that aren't yet release, so now is a great time! This update also (indirectly) updates the golang.org/x/net
dependency, which makes sure that consumers of this repo won't be vulnerable to CVE-2023-45288.
@emcfarlane, actually, I just realized it's pretty late in Switzerland and it's a Friday evening. So I'll go ahead merge, but if you have any questions or feedback, go ahead and leave comments. I can open a follow-up PR if there's anything that needs to be addressed.
Some of the updated behavior in connect-go tickled some bugs in vanguard, which were caught by the tests.
envelopingReader
was transforming an un-enveloped body (for Connect unary) to an enveloped one, it would include an extra, second, invalid envelope(!!). This wasn't previously caught because the older version of connect-go only tried to read a single request for unary RPCs and then effectively ignored the rest of the body. The newer connect-go validates that the client isn't erroneously sending more than one message, which brought this bug to light.The other fixes are making vanguard's test code more robust:
assert.Equal
on a*connect.Error
, which may containproto.Message
instances if there are error details, which do not correctly compare withassert.Error
. I've extract the comparison to a helper that checks all of the error properties and usesprotocmp
to compare the message values.