Open lynconEBB opened 2 weeks ago
Thanks for the report @lynconEBB , are you planning a PR, if not I will see about updating the implementation.
Also, could you describe a use case in which this would be used, so I can ensure we have test coverage for this pattern?
Hi @SimonDarksideJ, thank you for the quick response!
I’ve created a pull request to address this issue, which updates the rootProfile parameter type as previously discussed. This adjustment is aimed at providing greater flexibility in accessing service profiles.
For testing, I believe we can cover the essential use cases by calling TryGetServiceProfile with rootProfile instances of both SceneServiceProvidersProfile and ServiceProvidersProfile. Each test should validate that both types can access configurations and retrieve the appropriate profiles for the specified service.
You can review the pull request here: #113.
Thanks for your feedback on this!
When setting up a service using
SceneServiceProvider
, it seems the service profile configurations are not accessible from the mainServiceProvider
. As a result, theTryGetServiceProfile
function cannot retrieve the profile for the service, which impacts functionality.The current implementation of
TryGetServiceProfile
appears to restrict configuration lookup to only Providers of typeServiceProviderProfile
in therootProfile
parameter.Changing the
rootProfile
parameter toBaseServiceProfile<IService>
would enableSceneServiceProviderProfile
to be passed in. This change should make the configurations accessible and allowTryGetServiceProfile
to locate the correct profile, asSceneServiceProviderProfile
would contain the necessary configurations.