Skip to content
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

fix: Fix the issue of HTTP calling 404 when the first letter of RPC #15292

Open
wants to merge 1 commit into
base: 3.3
Choose a base branch
from

Conversation

paxxie2
Copy link

@paxxie2 paxxie2 commented Apr 1, 2025

method name in proto is capitalized (#15291)

What is the purpose of the change?

Fix the issue of HTTP calling 404 when the first letter of RPC method name in proto is capitalized (#15291)

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.77%. Comparing base (c778473) to head (dd876cb).

Additional details and impacted files
@@            Coverage Diff            @@
##                3.3   #15292   +/-   ##
=========================================
  Coverage     60.77%   60.77%           
- Complexity    10920    10922    +2     
=========================================
  Files          1886     1886           
  Lines         86122    86127    +5     
  Branches      12902    12903    +1     
=========================================
+ Hits          52337    52346    +9     
+ Misses        28331    28323    -8     
- Partials       5454     5458    +4     
Flag Coverage Δ
integration-tests 33.20% <100.00%> (+<0.01%) ⬆️
samples-tests 29.33% <0.00%> (-0.01%) ⬇️
unit-tests 58.91% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -130,6 +130,12 @@ public void register(Invoker<?> invoker) {
consumer.accept((methods) -> {
Method method = methods.get(0);
MethodDescriptor md = sd.getMethod(method.getName(), method.getParameterTypes());
if (md == null) {
String originMethodName = method.getName();
String upperMethod =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to add a length check, otherwise the method will fail with only one letter

Copy link
Author

@paxxie2 paxxie2 Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add a method name length check is possible.
  2. After testing , when there is only one character, there will be no problem.
  3. I will consider resolving this issue by modifying the dubbo-compiler or DefaultRequestMappingRegistry, taking into account the comprehensive impact scope and conducting thorough testing

@@ -130,6 +130,12 @@ public void register(Invoker<?> invoker) {
consumer.accept((methods) -> {
Method method = methods.get(0);
MethodDescriptor md = sd.getMethod(method.getName(), method.getParameterTypes());
if (md == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (md == null) {
if (md == null && md.getName().getLength()>1) {

Copy link
Author

@paxxie2 paxxie2 Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. After testing , when there is only one character, there will be no problem.

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.

4 participants