Fix hosted service registration ambiguity in channel runtime#314
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## dev #314 +/- ##
=======================================
Coverage 69.73% 69.74%
=======================================
Files 1139 1139
Lines 81170 81170
Branches 10619 10619
=======================================
+ Hits 56605 56612 +7
+ Misses 20469 20463 -6
+ Partials 4096 4095 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Summary
IHostedServiceregistration for the Lark inbox runtimeILarkConversationInboxand hosted startup bound to the same runtime instanceProblem
.NET 10rejectsTryAddEnumerable(ServiceDescriptor.Singleton<IHostedService>(factory))forIHostedServicebecause the implementation type is indistinguishable from other hosted-service registrations.AddChannelRuntime(...)hit that path during startup and the host failed before serving traffic.Solution
LarkConversationInboxRuntimeas the concrete singletonILarkConversationInboxresolving to that singletonLarkConversationInboxHostedServiceas a small adapter implementingIHostedServiceTryAddEnumerable(ServiceDescriptor.Singleton<IHostedService, LarkConversationInboxHostedService>())Verification
dotnet build src/Aevatar.Mainnet.Host.Api/Aevatar.Mainnet.Host.Api.csproj --nologo