Enhance OAuthBackendImpl with dynamic backend reference#3419
Enhance OAuthBackendImpl with dynamic backend reference#3419sfeilmeier merged 4 commits intoOpenEMS:developfrom
Conversation
1. Made the backend reference optional - Added cardinality = ReferenceCardinality.OPTIONAL so the component can activate even when Controller.Api.Backend is not configured 2. Added null safety checks - All three methods now check if backend is available before using it 3. Added proper error handling - Returns a failed CompletableFuture with a descriptive error message when backend is unavailable 4. Made the reference dynamic and volatile - Follows the same pattern as UserServiceImpl and AppCenterBackendUtilImpl
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #3419 +/- ##
=============================================
- Coverage 59.62% 59.61% -0.01%
Complexity 112 112
=============================================
Files 2894 2894
Lines 124658 124661 +3
Branches 9343 9344 +1
=============================================
- Hits 74318 74307 -11
- Misses 47522 47539 +17
+ Partials 2818 2815 -3 🚀 New features to boost your workflow:
|
|
@michaelgrill: What do you think? This currently causes the issue reported here: https://community.openems.io/t/fehler-und-wie-finde-ich-den-componentmanager-defective-null-unsatisfied-reference-for-backend/10609/2 |
|
tested the changes of @Sn0w3y works now without this error "unsatisfied reference" |
|
i would prefer a solution where we dont have to touch the Can we change the validation to only validate classes, which implement |
OsgiValidateWorker now only validates components implementing OpenemsComponent. OAuthBackendImpl is refactored to remove dynamic backend reference handling and logger usage, simplifying method implementations and dependency injection.
io.openems.edge.core/src/io/openems/edge/core/componentmanager/OsgiValidateWorker.java
Outdated
Show resolved
Hide resolved
|
could you update the PR information accordingly? Latest changes are quite different ;) |
|
I'll work on this to get rid of this issue for next release |
Shall i close this PR or would you work in this PR for it? |
Made the backend reference optional - Added cardinality = ReferenceCardinality.OPTIONAL so the component can activate even when Controller.Api.Backend is not configured
Added null safety checks - All three methods now check if backend is available before using it
Added proper error handling - Returns a failed CompletableFuture with a descriptive error message when backend is unavailable
Made the reference dynamic and volatile - Follows the same pattern as UserServiceImpl and AppCenterBackendUtilImpl