Skip to content

Conversation

cmeng-gao
Copy link

@cmeng-gao cmeng-gao commented Oct 17, 2025

The websocket server's "protos" request handler was using descriptor->DebugString() which only outputs message definitions, causing top-level enums (like PixelFormatType) to be omitted from the generated proto definitions sent to clients.

This caused protobuf.js clients to fail parsing the definitions because messages referenced enum types that were never defined.

Changes:

  • Extract and include all top-level enums from each proto file
  • Use fileDescriptor->enum_type_count() to iterate enums
  • Add deduplication sets for both files and enums
  • Keep using descriptor->DebugString() for messages to avoid including import statements that would break single-file parsing

The generated proto now includes all necessary enum definitions while remaining compatible with protobuf.js single-file parsing.

Fixes missing PixelFormatType, SphericalCoordinatesType, and other top-level enums in the websocket proto definitions.

Summary

  • ✅ Fixes missing top-level enums (PixelFormatType, etc.)
  • ✅ Makes proto definitions parseable by protobuf.js
  • ✅ Maintains backward compatibility
  • ✅ No breaking changes

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

@cmeng-gao cmeng-gao requested a review from arjo129 as a code owner October 17, 2025 05:01
@github-actions github-actions bot added the 🪵 jetty Gazebo Jetty label Oct 17, 2025
The websocket server's "protos" request handler was using
descriptor->DebugString() which only outputs message definitions,
causing top-level enums (like PixelFormatType) to be omitted from
the generated proto definitions sent to clients.

This caused protobuf.js clients to fail parsing the definitions
because messages referenced enum types that were never defined.

Changes:
- Extract and include all top-level enums from each proto file
- Use fileDescriptor->enum_type_count() to iterate enums
- Add deduplication sets for both files and enums
- Keep using descriptor->DebugString() for messages to avoid
  including import statements that would break single-file parsing

The generated proto now includes all necessary enum definitions
while remaining compatible with protobuf.js single-file parsing.

Fixes missing PixelFormatType, SphericalCoordinatesType, and other
top-level enums in the websocket proto definitions.

Signed-off-by: cmeng <cmeng.gao@gmail.com>
@cmeng-gao cmeng-gao force-pushed the fix/websocket-proto-enums branch from 91a08d9 to 03676b3 Compare October 17, 2025 05:12
@azeey
Copy link
Contributor

azeey commented Oct 17, 2025

Thanks for the contribution! I believe this is your first time contributing, so can you please go through the checklist and check-off relevant items?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪵 jetty Gazebo Jetty

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants