From e839c2ed8aec2c6981a6757b342dffa3da9f2278 Mon Sep 17 00:00:00 2001 From: GordonT0110 Date: Fri, 27 Feb 2026 20:45:45 +1100 Subject: [PATCH] fix(pkg/bus):return correct boolean signal when channel is closed --- pkg/bus/bus.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/bus/bus.go b/pkg/bus/bus.go index 58c0a25d5..29d3740b8 100644 --- a/pkg/bus/bus.go +++ b/pkg/bus/bus.go @@ -32,8 +32,8 @@ func (mb *MessageBus) PublishInbound(msg InboundMessage) { func (mb *MessageBus) ConsumeInbound(ctx context.Context) (InboundMessage, bool) { select { - case msg := <-mb.inbound: - return msg, true + case msg, ok := <-mb.inbound: + return msg, ok case <-ctx.Done(): return InboundMessage{}, false } @@ -50,8 +50,8 @@ func (mb *MessageBus) PublishOutbound(msg OutboundMessage) { func (mb *MessageBus) SubscribeOutbound(ctx context.Context) (OutboundMessage, bool) { select { - case msg := <-mb.outbound: - return msg, true + case msg, ok := <-mb.outbound: + return msg, ok case <-ctx.Done(): return OutboundMessage{}, false }