fix: an HTML page from the proxy is a passing outage, a full machine and a proof card in Finalizado are said before the move (DTF-WEB-1Z, 20, 21)
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 7m42s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m20s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-27 09:26:48 -03:00
parent ffc7d3153a
commit 5dc4135562
3 changed files with 14 additions and 1 deletions

View File

@@ -270,6 +270,10 @@ function renderBoard(){
// The card may have moved to another machine since the drag began (the
// board reloaded in between, Sentry DTF-WEB-1P): said, not refused.
if(!mayAct(order)){say('Pedido da '+(order.machine?.name||'outra máquina')+': só quem está nela move o card.');clearDrop();return;}
// A proof card ends with its answer, on the card (Sentry DTF-WEB-21).
if(state==='fin'&&order.proof_parent){
say('A prova termina com Prova OK ou Prova reprovada, no card da prova.');openPanel(order.id);clearDrop();return;
}
// Above 1 m Finalizado needs the review photo: the drop opens Revisão
// instead of a refused move (Sentry DTF-WEB-B).
if(state==='fin'&&order.state==='rev'&&needsReviewPhoto(order)){

View File

@@ -692,6 +692,13 @@ async function pullTo(order, machineId){
if(machine&&!(machine.products||[]).includes(/^uv/.test(order.snapshot.items[0]?.mode||'')?'uv':'textil')){
say('A '+machine.name+' não imprime este produto.');return;
}
// A machine with every place in Imprimindo taken (app/machines.py): said
// here, as its lane shows, and the card stays put (Sentry DTF-WEB-20).
if(machine){
const cap=machine.places||board.printing_cap||3;
const busy=(board.orders||[]).filter(o=>o.state==='imp'&&!o.cancelled_at&&o.machine?.id===machine.id&&o.id!==order.id).length;
if(busy>=cap){say('A '+machine.name+' já tem '+busy+' em Imprimindo. Abre vaga quando um pedido sair de lá.');return;}
}
const alert=(machine?.alerts||[]).find(row=>row.blocking);
if(alert&&!await machineAlertDialog(order,target,alert))return;
try{

View File

@@ -246,7 +246,9 @@ async function api(path,body,options={}){
catch(e){e.offline=true;throw e;}
// The network can also drop while the answer arrives (Sentry DTF-WEB-1E).
let d;
try{d=await r.json();}catch(e){if(e instanceof TypeError)e.offline=true;throw e;}
// An HTML page instead of the answer (the proxy while a container restarts,
// Sentry DTF-WEB-1Z) is as passing as no network: warned, reported if it lasts.
try{d=await r.json();}catch(e){if(e instanceof TypeError||e instanceof SyntaxError)e.offline=true;throw e;}
if(!r.ok){
// A validation error is a list: name its first field and what was wrong
// instead of the bare status (Sentry DTF-WEB-E).