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.
This commit is contained in:
777genius 2026-05-30 12:33:57 +03:00
parent ccea3e015d
commit d0c64fabb8
2 changed files with 12 additions and 0 deletions

View file

@ -25,6 +25,10 @@ export function setTeamWatchScopeChangeListener(listener: (() => void) | null):
scopeChangeListener = listener; scopeChangeListener = listener;
} }
export function notifyTeamWatchScopeChanged(): void {
scopeChangeListener?.();
}
function collectAliveTeams(scope: Set<string>): void { function collectAliveTeams(scope: Set<string>): void {
if (!aliveTeamsProvider) { if (!aliveTeamsProvider) {
return; return;

View file

@ -3,6 +3,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
import { import {
computeTeamWatchScope, computeTeamWatchScope,
markTeamEngaged, markTeamEngaged,
notifyTeamWatchScopeChanged,
resetTeamWatchScopeForTests, resetTeamWatchScopeForTests,
setAliveTeamsProvider, setAliveTeamsProvider,
setTeamWatchScopeChangeListener, setTeamWatchScopeChangeListener,
@ -53,6 +54,13 @@ describe('teamWatchScope', () => {
expect(listener).not.toHaveBeenCalled(); 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)', () => { it('survives a throwing alive provider (watcher falls back safely)', () => {
setAliveTeamsProvider(() => { setAliveTeamsProvider(() => {
throw new Error('boom'); throw new Error('boom');