Open paulsohn opened 1 week ago
@paulsohn Thanks for the proposed fix here - let us know when this is ready for review!
@defunctzombie Sure. It is a draft because I got no tests but I don't think further changes might be needed, so feel free to test this as it is (I will do my tests in next week)
@defunctzombie Fixed error so now this is properly ready for review.
Added some example in separate branch ( https://github.com/paulsohn/ws-protocol/tree/test-pr876 ).
After build, execute make example_server_client_pub
and make example_client_pub_json
(or ..._protobuf
) on separate shell in that order to test.
Are you currently reviewing this? If you don't mind, let me know the progress so far
By the way I just thought, it might affect ros-foxglove-bridge as well?
Changelog
C++ server/client: add missing implementations for client advertised schema / schema encoding
Docs
Description
Although foxglove ws protocol allow client to advertise complete schema definition string as well as schema name, current C++ implementation lacks such fields. Particularly:
ClientAdvertisement
struct lacksschemaEncoding
field,ClientAdvertisement
struct hasschema
field, but it is never populated (websocket server does not read schema or schema encoding to json)This PR resolves above problems, and additionally since this is breaking change from unimplemented to implemented, types are decided as following:
schema
field type is changed fromstd::vector<uint8_t>
tostd::optional<std::string>
, as schema fields are passed in as json quoted string, and it's optionalschemaEncoding
field type is determined asstd::optional<std::string>
, the same reason forschema
.Fixes: foxglove/ws-protocol#875 Fixes: FG-9447