-
Notifications
You must be signed in to change notification settings - Fork 361
Fix websocket server proto definitions to include top-level enums #3130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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]>
91a08d9 to
03676b3
Compare
|
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? |
|
Sorry, is there anything else I need to do regarding this MR? |
iche033
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI failures should be unrelated. Changes look good to me.
|
@Mergifyio backport main |
✅ Backports have been created
|
) 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)
) 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)
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:
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
Checklist
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.