Refresh erroneous documents to detect server-side fixes

- Include erroneous server documents in auto-refresh
- Documents can transition from ERRONEOUS to SHIPPABLE when fixed on server
- Clear error message when document status becomes non-erroneous
- Properly handle status transitions in refresh flow

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-16 22:56:39 +01:00
parent 24daa4bf82
commit e5f3f583d1
2 changed files with 13 additions and 4 deletions

View File

@@ -987,10 +987,13 @@ async function handleRefreshAll() {
return;
}
// Find all documents that have been uploaded and are still visible
// Find all documents that have been uploaded and might change status
// Include erroneous docs - they can be fixed on the server and become shippable
const uploadedDocs = pdfQueue.filter(p =>
p.binectDocumentId &&
(p.binectStatus === 'in_basket' || p.binectStatus === 'in_production')
(p.binectStatus === 'in_basket' ||
p.binectStatus === 'in_production' ||
(p.binectStatus === 'failed' && p.binectStatusCode === 7)) // Erroneous on server
);
if (uploadedDocs.length === 0) {
@@ -1079,9 +1082,10 @@ async function handleRefreshStatus(id: string) {
pdf.binectStatus = newStatus;
pdf.binectStatusCode = result.status;
pdf.binectStatusText = result.statusText;
if (result.price) pdf.price = result.price;
if (result.price !== undefined) pdf.price = result.price;
if (result.recipientAddress) pdf.recipientAddress = result.recipientAddress;
if (result.errorDetails) pdf.errorMessage = result.errorDetails;
// Clear or set error message based on status
pdf.errorMessage = result.errorDetails || undefined;
renderPDFList();
} catch (error) {