-
Notifications
You must be signed in to change notification settings - Fork 24
fix(fxhttpserver): Fix HTTP handlers/middlewares dependency injection signature #362
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(fxhttpserver): Fix HTTP handlers/middlewares dependency injection signature #362
Conversation
If it's ok, I will make separate PR for all modules with this functions. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #362 +/- ##
==========================================
+ Coverage 95.17% 98.41% +3.24%
==========================================
Files 177 15 -162
Lines 6999 819 -6180
==========================================
- Hits 6661 806 -5855
+ Misses 237 9 -228
+ Partials 101 4 -97
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi, thanks for the contribution 🙏 There's an issue with the CI linter, I check as soon as I can, then I release your change 👍 |
@damnedest, I tried to fix linter in #363, it's on main. Could you please rebase your branch and push again ? |
…ng full import path in type IDs
579f361
to
4607642
Compare
@ekkinox done |
@ekkinox Do you mind if I make same PRs in other components with a similar change? Each component - one PR? |
Yokai release is based on a bot that requires modules (fxhttpserver, fxgrpcserver, etc) to each have a dedicated PR in order to correctly tag/release them independently. Like you did for fxhttpserver. Before starting, in which other module do you want to make a similar change? |
@ekkinox Same implementation of GetType/GetReturnType exists in: |
Ok 👌 If you have the motivation to make a PR for each one, it'll be very welcomed 🤩 |
Fixes #361
What changed:
Replaced reflect.Type.String()-based type identification with a robust builder that uses PkgPath() + Name() for named types, after unwrapping pointers and inspecting constructor return types. Updated GetType and GetReturnType accordingly.
Why:
To prevent resolution collisions between handlers/middlewares that share the same package and type names under different import paths (e.g., admin vs public), which led to the wrong handler being invoked.
How to reproduce the bug (before the fix):
How to verify the fix: