Skip to content

fix: descriptor extensions handling post-editions #2075

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

Merged
merged 6 commits into from
May 28, 2025
Merged

Conversation

mkruskal-google
Copy link
Contributor

This extension had virtually no test coverage and was already fairly buggy in proto2/proto3. The addition of editions support broke it completely though, notably #2068 which added some caching that doesn't work in the case of root-less types.

This PR adds some basic test coverage, and cleans up the code to work more smoothly under editions. It is still not safe to use it in the following cases, where it will produce bad results:

  • Converting descriptors from one syntax/edition to another
  • Loading partial editions descriptors (e.g. calling fromDescriptor on anything but a Root node)

Fixes #2072

@sofisl sofisl merged commit 6e255d4 into master May 28, 2025
6 checks passed
@github-actions github-actions bot mentioned this pull request May 28, 2025
@mkruskal-google mkruskal-google deleted the descriptor-ext branch May 28, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v7.5.2 breaks protobuf.Type.encode and protobuf.Type.create methods
2 participants