feat: refine messenger factory to prevent conflicting state shapes for IDialerCallStatus and ICodecCallControls

This commit is contained in:
Neil Dorin 2026-07-02 17:21:06 -06:00
parent d771320fff
commit f3f7755735
2 changed files with 7 additions and 2 deletions

View file

@ -32,7 +32,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <inheritdoc />
protected override void RegisterActions()
{
base.RegisterActions();

View file

@ -168,7 +168,13 @@ namespace PepperDash.Essentials
new MessengerFactoryEntry(
typeof(IHasDialer),
(d, mp, ck) => new IHasDialerMessenger(
$"{d.Key}-dialer-{ck}", mp, d)
$"{d.Key}-dialer-{ck}", mp, d),
// IDialerCallStatus and ICodecCallControls both extend IHasDialer and each already
// provide their own richer messenger (posting a "calls" array) subscribed to the same
// CallStatusChange event and the same "/device/{key}" message path. Without this
// exclusion, a device implementing either interface would get both messengers posting
// conflicting state shapes ("callItem" vs "calls") to the same clients.
predicate: d => d is IHasDialer && !(d is IDialerCallStatus) && !(d is ICodecCallControls)
),
new MessengerFactoryEntry(
typeof(ICodecCallControls),