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(music-video): reload project on render completion to clear stale render status

Adam Eivy16cfb486f117
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 080202f62f..b8d34f4057 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -341,10 +341,10 @@ export default function MusicVideo() {
});
const renderJob = useMusicVideoRenderJob({
project: selected,
- // A cancelled or dropped render says nothing about the project's status: ask
- // the server, or the board keeps showing a render that is gone (#9940).
+ // A finished, cancelled or dropped render updates or resets the project's
+ // status and renderDependencyState: ask the server to sync the full record (#9940).
onSettled: (reason, projectId) => {
- if (reason === 'complete' || reason === 'error') return;
+ if (reason === 'error') return;
getMusicVideoProject(projectId, { silent: true }).then(replaceProject).catch(() => {});
},
onRendered: (projectId, result) => patchProject(projectId, (project) => ({
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index 501c4508a8..6db19587b2 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -610,6 +610,35 @@ describe('MusicVideo render control (#1760)', () => {
await waitFor(() => expect(renderMusicVideoProject).toHaveBeenCalledWith('mv-1', { silent: true }));
});
+ it('reloads the project when render finishes so stale render status clears and new render loads', async () => {
+ const staleProject = {
+ ...PROJECT_WITH_CLIP,
+ renderHistoryId: 'rh-old',
+ renderDependencyState: { status: 'stale', reasons: ['Scene clip changed'] },
+ };
+ const freshProject = {
+ ...PROJECT_WITH_CLIP,
+ renderHistoryId: 'rh-new',
+ status: 'complete',
+ renderDependencyState: { status: 'current', reasons: [] },
+ };
+ let currentProject = staleProject;
+ getMusicVideoProject.mockImplementation(async (id) => (id === staleProject.id ? currentProject : null));
+ await openProject(staleProject, 'review');
+ expect(screen.getAllByText(/Final render is out of date/i).length).toBeGreaterThan(0);
+
+ sseState.latest = null;
+ currentProject = freshProject;
+ fireEvent.click(screen.getByRole('button', { name: /^Render final$/ }));
+ await screen.findByTitle('Cancel render');
+
+ sseState.latest = { type: 'complete', result: { id: 'rh-new' } };
+ forceRerender();
+ await waitFor(() => expect(toast.success).toHaveBeenCalledWith('Music video rendered'));
+ await waitFor(() => expect(getMusicVideoProject).toHaveBeenCalledWith(staleProject.id, { silent: true }));
+ await waitFor(() => expect(screen.queryAllByText(/Final render is out of date/i)).toHaveLength(0));
+ });
+
it('reserves preparation across project navigation and applies completion to the captured project', async () => {
const other = { ...PROJECT_WITH_CLIP, id: 'mv-other', name: 'Other Project' };
listMusicVideoProjects.mockResolvedValue([PROJECT_WITH_CLIP, other]);