fix(grpc-reflection): try to do FQN lookup with a leading period #2941
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.
This seems to fix a very specific issue, where if the custom field type doesn't have a package, it breaks the reflection API.
Please see this issue for more information: #2934
I haven't added any tests because I couldn't reproduce the issue using the test setup in test-reflection-v1-implementation.ts.
But I did test it manually, and below you can find my test evidence.
Testing
Pre-requisite: add a new imported message, which doesn't have a package. And make it a field of a request or response, e.g. this diff
Also, here a complete diff in case my branch gets deleted (click to expand)
Without the fix
Running the application
Warnigns are printed at the bottom because the reflection service couldn't find the reference for the message with no package:
Loading service definition via Reflection

Postman fails to load the definition. And in the
[Service definitions]
tab it shows this error:With the fix
Running the application
Warnings no longer printed:
Loading service definition via Reflection

Postman can successfully load the definition.
Also, it understands the new nested field and can generate some example message.
