fix: a pull on a card changed elsewhere tries once more, and a file held by the FlexiPRINT is a warning (DTF-WEB-K, DTF-WEB-M)
Some checks failed
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Failing after 2m51s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Has been skipped

Pull: on "O pedido mudou" the board reloads; a card still in Arte
conferida is pulled again with the fresh version, one already printing
on that machine is left as it is, anything else reports the conflict.

Folders: a file another program holds open is expected while the
FlexiPRINT reads it. The first pass warns without the error flag, so it
no longer reaches Sentry; only a file still held after 10 passes (about
5 minutes) is an error.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-16 16:18:19 -03:00
parent 9de9b6abe1
commit 5cf8cd1d54
2 changed files with 30 additions and 3 deletions

View File

@@ -636,12 +636,28 @@ async function pullTo(order, machineId){
const alert=(machine?.alerts||[]).find(row=>row.blocking);
if(alert&&!await machineAlertDialog(order,target,alert))return;
try{
await move(order,'imp','',target);
await pullMove(order,target);
}catch(e){
if(e.status===409&&String(e.message).startsWith('Antes do próximo arquivo')){say(e.message,true);return;}
throw e;
}
}
// The card changed elsewhere between the board's load and the pull (another
// tab or person; the machine alert in between gives it time): reload and, if
// it still waits in Arte conferida, pull once more with the fresh version;
// the server checks everything again (Sentry DTF-WEB-K, as DTF-WEB-7).
async function pullMove(order,target){
try{
await move(order,'imp','',target);
}catch(error){
if(error.status!==409||!String(error.message).startsWith('O pedido mudou'))throw error;
await load();
const fresh=(board.orders||[]).find(row=>row.id===order.id);
if(fresh?.state==='imp'&&fresh.machine?.id===target){say('O pedido já estava imprimindo nesta máquina.');return;}
if(!fresh||fresh.cancelled_at||fresh.state!=='tra')throw error;
await move(fresh,'imp','',target);
}
}
// Minha conta: who is signed in, and the password, which only the person changes.
function accountForm(){