fix: approving finals on an order changed elsewhere tries once more with the fresh version (DTF-WEB-7)
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Failing after 5m55s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Has been skipped

The first fix stays quiet when the finals were already approved or the order
left Arte recebida/Correção. Order #28 changed in another tab while the
panel was open and still waited for its finals, so the 409 came back. The
person had already confirmed those files: the Kanban now reloads and sends
them once more with the fresh version (the server checks everything again),
and only reports if that fails too or the order was cancelled.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-16 13:41:19 -03:00
parent f2b825b652
commit 050a823bcb

View File

@@ -506,6 +506,13 @@ async function saveFinalFiles(order, files, note){
say('O arquivo final já estava aprovado.');
return true;
}
// Changed elsewhere meanwhile (another tab or person) and still waiting for
// these finals: the person already confirmed them, so try once more with
// the fresh version; the server checks everything again (Sentry DTF-WEB-7).
if(fresh&&!fresh.cancelled_at){
await api('/orders/'+order.id+'/final-files',{version:fresh.version,files,note});
return false;
}
throw error;
}
}