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: guard readiness lookup before a project loads (#10136)

Adam Eivyee6efe8629a9
diff --git a/client/src/hooks/useMusicVideoProductionReview.js b/client/src/hooks/useMusicVideoProductionReview.js
index c59abdc67f..22953d2111 100644
--- a/client/src/hooks/useMusicVideoProductionReview.js
+++ b/client/src/hooks/useMusicVideoProductionReview.js
@@ -56,7 +56,7 @@ export default function useMusicVideoProductionReview({ project, replaceProject
} catch (err) { if (latest.current === owner) setError(err.message); return null; }
finally { setBusy(false); }
};
- const readiness = project?.productionReadiness || (state?.id === project?.id ? state.readiness : null);
+ const readiness = project?.productionReadiness || (state && state.id === project?.id ? state.readiness : null);
return { readiness, readinessError: readiness ? null : readinessError, busy, error, proof: { ...proof, occupied: proof.active, active: proof.active && proof.context === project?.id },
feedback: body => call(() => addMusicVideoProductionFeedback(project.id, { ...body, basis: readiness?.basis[body.stage] }, { silent: true })),
resolveFeedback: (feedbackId, resolution) => call(() => resolveMusicVideoProductionFeedback(project.id, { feedbackId, resolution }, { silent: true })),
diff --git a/client/src/hooks/useMusicVideoProductionReview.test.jsx b/client/src/hooks/useMusicVideoProductionReview.test.jsx
index 23d8ea487d..a2c28a2be2 100644
--- a/client/src/hooks/useMusicVideoProductionReview.test.jsx
+++ b/client/src/hooks/useMusicVideoProductionReview.test.jsx
@@ -33,6 +33,11 @@ describe('useMusicVideoProductionReview readiness source (#10136)', () => {
expect(result.current.readiness).toBeNull();
});
+ it('renders with no project loaded yet', () => {
+ const { result } = run(null);
+ expect(result.current.readiness).toBeNull();
+ });
+
it('surfaces a failed readiness fetch instead of silently reading not done', async () => {
api.getMusicVideoProductionReview.mockRejectedValue(new Error('boom'));
const { result } = run({ id: 'a' });