Skip to content

Commit

Permalink
grpc: Convert key to a bytes field
Browse files Browse the repository at this point in the history
Galaxycache is perfectly fine with non-UTF-8 keys, but some go Protobuf
library versions validate UTF-8 conformance when serializing
string-fields.

We can side-step this by setting the field definitions to conform to the
protobuf spec by putting our possibly-not-utf-8 strings in a bytes
field.

Fortunately, string and bytes fields are 100% wire compatible, so
switching the type only creates a mild API break.

I doubt anyone's using these protobuf messages directly, so I'm just
going to declare that they aren't covered by v1.x compatibility.

Also, regenerate the protobuf types with the current protobuf library
(google.golang.org/protobuf instead of github.com/golang/protobuf).

Include a test to guarantee that this does the right thing with invalid
UTF-8.
  • Loading branch information
dfinkel committed Jun 14, 2023
1 parent e8ff957 commit c862314
Show file tree
Hide file tree
Showing 6 changed files with 333 additions and 168 deletions.
Loading

0 comments on commit c862314

Please sign in to comment.