Skip to content

fix(service): fix dynamic_cast type-identity bug in ProvidedServices … - #919

Draft
Chahult wants to merge 1 commit into
eclipse-score:mainfrom
Chahult:fix/v0.2.1_provided_service_container_count
Draft

fix(service): fix dynamic_cast type-identity bug in ProvidedServices …#919
Chahult wants to merge 1 commit into
eclipse-score:mainfrom
Chahult:fix/v0.2.1_provided_service_container_count

Conversation

@Chahult

@Chahult Chahult commented Aug 13, 2026

Copy link
Copy Markdown

…lookup

ProvidedServiceBuilder::DecoratorType was a distinct subclass of ProvidedServiceDecorator instead of a pass-through alias, so ProvidedServices (used for internal storage in some places) and ProvidedServicesProvidedServiceBuilder::DecoratorType (used at GetServices<>() lookup call sites) were unrelated template instantiations. dynamic_cast between them always failed, so GetServices<>() silently returned nullptr and Has<>()/Get<>() always failed, even though the service had actually been added successfully (NumServices() > 0).

Fix: make DecoratorType a pure pass-through alias for ProvidedServiceDecorator, and use ProvidedServiceBuilder::DecoratorType consistently for internal storage and the backward-compat mw_com::ProvidedServices alias.

Also adds ProvidedServiceDecorator::ExtractService() and extends proxy_needs.h's Optional stub to accept/expose a pending ProxyFuture (GetProxyFuture()/StopServiceDiscovery()) so call sites written against the full (non-stub) ProxyData API compile unchanged.

Verified against the real config_daemon binary: previously crashed at runtime with "ConfigDaemon::Run Failed to create
InitialQualifierStateSender callback" (exit code 1); now runs successfully. Also fixes 2 previously-failing tests in config_management's unit_test_mw_com (all 10/10 now pass).

…lookup

DecoratorType was a subclass instead of a pass-through alias, making
ProvidedServices<ProvidedServiceDecorator> and
ProvidedServices<DecoratorType> unrelated types, so dynamic_cast-based
lookups (GetServices/Get/Has) always failed even after a service was
added. Fix: make DecoratorType a pure alias and use it consistently.

Fixes config_daemon crashing with "Failed to create
InitialQualifierStateSender callback".
@Chahult
Chahult force-pushed the fix/v0.2.1_provided_service_container_count branch from 9a91fc9 to bab588a Compare August 14, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant