Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: refresh cleanup inventory only when shot renders settle

[._.]/ Adam Eivy0286970b9ed2
diff --git a/client/src/components/musicVideo/stages/CleanupStage.jsx b/client/src/components/musicVideo/stages/CleanupStage.jsx
index 23cb473542..36fe4c3049 100644
--- a/client/src/components/musicVideo/stages/CleanupStage.jsx
+++ b/client/src/components/musicVideo/stages/CleanupStage.jsx
@@ -35,14 +35,15 @@ export default function CleanupStage({ board }) {
setLoadError(null);
refresh.current();
const onChange = event => { if (event.projectId === project.id) refresh.current(); };
+ const onShotSettled = event => { if (event.state !== 'rendering') onChange(event); };
const onConnect = () => refresh.current();
socket.on('music-video:render-cleanup', onChange);
- socket.on('music-video:shot-render', onChange);
+ socket.on('music-video:shot-render', onShotSettled);
socket.on('connect', onConnect);
return () => {
generation.current += 1;
socket.off('music-video:render-cleanup', onChange);
- socket.off('music-video:shot-render', onChange);
+ socket.off('music-video:shot-render', onShotSettled);
socket.off('connect', onConnect);
};
}, [project.id, project.renderHistoryId, project.updatedAt]);
diff --git a/client/src/components/musicVideo/stages/CleanupStage.test.jsx b/client/src/components/musicVideo/stages/CleanupStage.test.jsx
index 03b62d9ec2..16059a7182 100644
--- a/client/src/components/musicVideo/stages/CleanupStage.test.jsx
+++ b/client/src/components/musicVideo/stages/CleanupStage.test.jsx
@@ -19,6 +19,9 @@ describe('production cleanup', () => {
it('removes derived renders while keeping comparisons by default, then offers explicit look purging', async () => {
render(<CleanupStage board={{ project: { id: 'example-project' } }} />);
const cleanup = await screen.findByRole('button', { name: 'Remove superseded renders' });
+ const onShot = socket.on.mock.calls.find(([event]) => event === 'music-video:shot-render')[1];
+ await act(async () => { onShot({ projectId: 'example-project', state: 'rendering', progress: 0.5 }); });
+ expect(getMusicVideoRenderCleanup).toHaveBeenCalledTimes(1);
expect(screen.getByText(/Source takes, stills, and cutting-room content stay in Assets/)).toBeInTheDocument();
expect(screen.getByText(/Kept: Referenced/)).toBeInTheDocument();
fireEvent.click(cleanup);