Don't build symbols we already have in the state#59
Merged
mjheilmann merged 3 commits intofeature/cleanup_and_recursionfrom Dec 20, 2025
Conversation
test/service/builder_test.exs
Outdated
Contributor
There was a problem hiding this comment.
This fix works for the server side but not the client side. This approach still generates separate files (recursive_message.Request.proto, recursive_message.Reply.proto), even though both messages live in the same source proto. Reflection clients (grpcurl, the Go reflection client, etc.) follow the dependency list, so they’ll bounce back and forth between those synthetic files forever and never resolve the request. In practice that means a FileByFilename loop and eventually a stack overflow—the exact failure we’re trying to eliminate.
Collaborator
Author
There was a problem hiding this comment.
So the clients are relying on protocol not supporting circular dependencies, so they don't cover it. Interesting
…p-when-messages-in-the-same-proto-file-reference-each-other
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While building the reflection tree, the build resolution can get stuck in a loop with messages that refer to each-other.
The root cause is that we didn't check if we already had added the field symbol to the state before processing it. Adding this check prevents the recursion problem and allows the build to complete the tree.