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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: offer recovery after a job status read fails (#8600)
[._.]/ Adam Eivy991d37891c4f
diff --git a/client/src/pages/CodeAnimation.jsx b/client/src/pages/CodeAnimation.jsxindex 24e0a5b3d5..d8838fe8f0 100644--- a/client/src/pages/CodeAnimation.jsx+++ b/client/src/pages/CodeAnimation.jsx@@ -375,7 +375,7 @@ export default function CodeAnimation() {const jobResource = useSocketResource(async () => {if (!jobId) return null;// Only a 404 means the job is gone. Transient failures retain the current- // output and recover on the next event, reconnect or tab re-show.+ // output and offer retry, with recovery on events, reconnect or tab re-show.return getCodeAnimationJob(jobId, { silent: true }).catch((error) => {if (error.status === 404) return { id: jobId, status: 'missing', error: error.message };throw error;@@ -862,6 +862,12 @@ export default function CodeAnimation() {{job?.status === 'failed' && <span className="text-xs text-port-error">Generation failed: {job.error}</span>}{job?.status === 'missing' && <span className="text-xs text-gray-500">That generation is no longer available.</span>}</div>+ {jobResource.error && (+ <div role="status" className="flex flex-wrap items-center gap-2 text-xs text-port-error">+ <span>Could not refresh this generation. Its displayed status may be out of date.</span>+ <button type="button" onClick={jobResource.refetch} className={buttonSecondary}>Retry job status</button>+ </div>+ )}<details className="text-xs text-gray-400"><summary className="cursor-pointer select-none">Preview HTML from another LLM</summary><div className="mt-2 space-y-2">diff --git a/client/src/pages/CodeAnimation.test.jsx b/client/src/pages/CodeAnimation.test.jsxindex c21eb7d6e4..9fb59468a6 100644--- a/client/src/pages/CodeAnimation.test.jsx+++ b/client/src/pages/CodeAnimation.test.jsx@@ -172,6 +172,20 @@ describe('Code Animation page', () => {expect(getCodeAnimationJob).toHaveBeenCalledTimes(3);});+ it('offers recovery when the final event read fails without discarding the displayed job', async () => {+ getCodeAnimationJob.mockResolvedValue(runningJob);+ await renderPage('/code-animation/job-1');+ getCodeAnimationJob.mockRejectedValueOnce(new Error('Temporary outage'));+ await emitSocket('code-animation:changed', { id: 'job-1' });+ expect(screen.getByText(/displayed status may be out of date/)).toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'Generating…' })).toBeDisabled();+ getCodeAnimationJob.mockResolvedValue(completedJob);+ await userEvent.setup().click(screen.getByRole('button', { name: 'Retry job status' }));+ expect(getCodeAnimationJob).toHaveBeenCalledTimes(3);+ expect(screen.getByRole('button', { name: 'Run with audio' })).toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Retry job status' })).not.toBeInTheDocument();+ });+it('drops a pending response after selecting another job and releases listeners on unmount', async () => {let resolveFirst;getCodeAnimationJob.mockImplementationOnce(() => new Promise(resolve => { resolveFirst = resolve; }))