fix(service): fix dynamic_cast type-identity bug in ProvidedServices … - #919
Draft
Chahult wants to merge 1 commit into
Draft
fix(service): fix dynamic_cast type-identity bug in ProvidedServices …#919Chahult wants to merge 1 commit into
Chahult wants to merge 1 commit into
Conversation
Chahult
requested review from
LittleHuba,
bemerybmw,
castler,
crimson11,
hoe-jo and
limdor
as code owners
August 13, 2026 09:48
castler
marked this pull request as draft
August 13, 2026 11:08
…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
force-pushed
the
fix/v0.2.1_provided_service_container_count
branch
from
August 14, 2026 04:46
9a91fc9 to
bab588a
Compare
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.
…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).