Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Nov 7, 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

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.


This is an automatic backport of pull request #3130 done by [Mergify](https://mergify.com).

)

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 <[email protected]>
(cherry picked from commit f53d4ab)
@arjo129 arjo129 enabled auto-merge (squash) November 9, 2025 07:18
@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Nov 10, 2025
@iche033 iche033 disabled auto-merge November 10, 2025 21:32
@iche033 iche033 merged commit b57deb9 into main Nov 10, 2025
12 of 13 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Nov 10, 2025
@iche033 iche033 deleted the mergify/bp/main/pr-3130 branch November 10, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants