From 94837a60cf1dfc8c97b68ed4b4e77783cd0b8e22 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 8 Jul 2026 15:37:14 -0600 Subject: [PATCH] feat: update debounce timer logic to handle multiple input ports for a single sink --- .../Routing/RoutingFeedbackManager.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs b/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs index eac9b83a..4819de30 100644 --- a/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs +++ b/src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs @@ -279,9 +279,15 @@ namespace PepperDash.Essentials.Core.Routing if (destination == null) return; - var key = destination.Key; + // Keyed by destination AND input port, not just destination: a single sink can have + // several independently-routed input ports (e.g. a codec with multiple simultaneous + // USB camera inputs, all downstream of the same midpoint). Keying by destination alone + // meant updates for one port would cancel/replace the still-pending debounce timer for + // a sibling port on the same sink, so only the last-processed port's update ever + // actually ran - the others silently never got refreshed. + var key = destination.Key + ":" + (inputPort?.Key ?? string.Empty); - // Cancel existing timer for this sink + // Cancel existing timer for this specific sink/port combination if (updateTimers.TryGetValue(key, out var existingTimer)) { existingTimer.Stop();