fix: completed images auto-join the library; chat image cards retry transient status failures instead of freezing

This commit is contained in:
Daniel 2026-09-09 04:09:29 +02:00
parent fe63014a1f
commit a4945d4d1d
2 changed files with 4 additions and 1 deletions

View file

@ -1710,6 +1710,7 @@ import {
renderImageJobs(row.querySelector('.assistant-bubble') || row, message.imageJobs, 'clinical_assistant', function(card, data) {
card.insertAdjacentHTML('beforeend', imageStore.renderGeneratedImage(data.imageUrl, 'Generated teaching visual', data.downloadUrl));
exporter.invalidate();
loadImageGallery(); // completed images join the user's library immediately
});
}

View file

@ -91,7 +91,9 @@ export function renderImageJobs(container, jobs, workflow, onDone) {
if (data.status === 'error') return;
} catch (error) {
if (!validSharingOwner(ticket) || error.name === 'AbortError') return;
status.textContent = 'Image status unavailable. Reopen image history to resume; no new paid job was started.';
// Transient status failures keep polling; the job is durable server-side.
status.textContent = 'Image: checking status…';
setTimeout(poll, 2500);
return;
}
setTimeout(poll, 2000);