From d0c64fabb84249b932ddfcc5c7d30c19b995ce83 Mon Sep 17 00:00:00 2001 From: 777genius Date: Sat, 30 May 2026 12:33:57 +0300 Subject: [PATCH] fix: export notifyTeamWatchScopeChanged so the committed build resolves TeamProvisioningService imports notifyTeamWatchScopeChanged (added with the setAliveRunId/deleteAliveRunId helpers) but the export was missing, so a clean checkout of the branch failed to typecheck. Add the export plus a test; the call-site wiring stays as in-progress work. --- src/main/services/infrastructure/teamWatchScope.ts | 4 ++++ test/main/services/infrastructure/teamWatchScope.test.ts | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/services/infrastructure/teamWatchScope.ts b/src/main/services/infrastructure/teamWatchScope.ts index e553f737..0137882b 100644 --- a/src/main/services/infrastructure/teamWatchScope.ts +++ b/src/main/services/infrastructure/teamWatchScope.ts @@ -25,6 +25,10 @@ export function setTeamWatchScopeChangeListener(listener: (() => void) | null): scopeChangeListener = listener; } +export function notifyTeamWatchScopeChanged(): void { + scopeChangeListener?.(); +} + function collectAliveTeams(scope: Set): void { if (!aliveTeamsProvider) { return; diff --git a/test/main/services/infrastructure/teamWatchScope.test.ts b/test/main/services/infrastructure/teamWatchScope.test.ts index 70446671..5901c34f 100644 --- a/test/main/services/infrastructure/teamWatchScope.test.ts +++ b/test/main/services/infrastructure/teamWatchScope.test.ts @@ -3,6 +3,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import { computeTeamWatchScope, markTeamEngaged, + notifyTeamWatchScopeChanged, resetTeamWatchScopeForTests, setAliveTeamsProvider, setTeamWatchScopeChangeListener, @@ -53,6 +54,13 @@ describe('teamWatchScope', () => { expect(listener).not.toHaveBeenCalled(); }); + it('can notify after alive team scope changes outside engagement', () => { + const listener = vi.fn(); + setTeamWatchScopeChangeListener(listener); + notifyTeamWatchScopeChanged(); + expect(listener).toHaveBeenCalledTimes(1); + }); + it('survives a throwing alive provider (watcher falls back safely)', () => { setAliveTeamsProvider(() => { throw new Error('boom');