From 12e4740f06c75558b8fb730b47ac50c82a9d4c02 Mon Sep 17 00:00:00 2001 From: KrasimirKralev <263465593+KrasimirKralev@users.noreply.github.com> Date: Wed, 26 Aug 2026 08:33:15 +0000 Subject: [PATCH] refactor(realtime): drop unused Hub.PublishMany batch wrapper Hub.PublishMany is a batch wrapper over Hub.Publish with no production caller. deadcode reports it unreachable from the clickclack binary; every runtime emit site calls Publish with a single event, and the method has never had a production caller since it was introduced. Remove it and repoint the one single-element test emit to Publish, preserving the workspace-isolation assertion. Behavior-preserving, net -6 production LOC. --- apps/api/internal/realtime/hub.go | 6 ------ apps/api/internal/realtime/hub_test.go | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/api/internal/realtime/hub.go b/apps/api/internal/realtime/hub.go index 17c118411..9c9453ba1 100644 --- a/apps/api/internal/realtime/hub.go +++ b/apps/api/internal/realtime/hub.go @@ -56,9 +56,3 @@ func (h *Hub) Publish(event store.Event) { } } } - -func (h *Hub) PublishMany(events []store.Event) { - for _, event := range events { - h.Publish(event) - } -} diff --git a/apps/api/internal/realtime/hub_test.go b/apps/api/internal/realtime/hub_test.go index bdaf7def8..42081dd2a 100644 --- a/apps/api/internal/realtime/hub_test.go +++ b/apps/api/internal/realtime/hub_test.go @@ -24,7 +24,7 @@ func TestHubSubscribePublishAndUnsubscribe(t *testing.T) { t.Fatal("timed out waiting for event") } - hub.PublishMany([]store.Event{{ID: "evt_2", WorkspaceID: "wsp_other"}}) + hub.Publish(store.Event{ID: "evt_2", WorkspaceID: "wsp_other"}) select { case got := <-events: t.Fatalf("unexpected event for other workspace: %#v", got)