santa icon indicating copy to clipboard operation
santa copied to clipboard

Replace the manual parser in santactl/sync with a protobuf

Open russellhancox opened this issue 5 years ago • 4 comments

Proto3 has a canonical JSON encoding for proto messages (though as far as I can tell this isn't supported by the Objective-C library at the moment).

It would be nice to use this instead of our hand-written JSON parser, which while fuzzed and probably relatively bug-free now is a bit of a pain to maintain and it's a lot of code. It would also allow the proto file to serve as documentation of what fields are in each request and response and and how those fit together.

Unfortunately this will have to wait until after switching to Bazel for building (as the alternative is a lot more work) and for the ObjC API to support JSON encoding, otherwise we'll have to use the C++ API (which wouldn't be terrible but would involve a lot of conversions from NSString to std::string)

russellhancox avatar Sep 26 '18 21:09 russellhancox

Would also be great to be able to use the interface definition in Upvote and not manually duplicate it.

msuozzo avatar Sep 26 '18 23:09 msuozzo

Good point. Thankfully the Python API does have functions for converting to and from JSON, so that's nice.

russellhancox avatar Sep 27 '18 00:09 russellhancox

At this point I think this is blocked by #744.

pmarkowsky avatar Mar 14 '22 20:03 pmarkowsky

This is not blocked by #744 and probably worth doing around the 2023.10 release.

pmarkowsky avatar Aug 16 '23 18:08 pmarkowsky