fix: a handled "O pedido mudou" no longer reaches Sentry (DTF-WEB-7, DTF-WEB-K), and the 90-day chart is readable on a phone
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 7m35s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 59s

saveFinalFiles and pullMove answer a stale-version 409 by reloading and
trying once more, but api() had already reported it. The first call now
expects the 409; one they cannot answer is still reported (reportRefusal),
and any other status is reported by api() as before, once.

Past a month the chart's gap is 1 px (90 bars were under 1 px each on a
375 px phone), and the last date ends at the chart's edge instead of being cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-12-01 12:46:44 -03:00
parent c2ffe08db5
commit 741db76fa9
6 changed files with 31 additions and 10 deletions

View File

@@ -716,14 +716,16 @@ async function pullTo(order, machineId){
// 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){
const path='/orders/'+order.id+'/move';
try{
await move(order,'imp','',target);
// The first 409 is answered below, so it is not reported (as saveFinalFiles).
await move(order,'imp','',target,{expected:[409]});
}catch(error){
if(error.status!==409||!String(error.message).startsWith('O pedido mudou'))throw error;
if(error.status!==409||!String(error.message).startsWith('O pedido mudou'))throw reportRefusal(path,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;
if(!fresh||fresh.cancelled_at||fresh.state!=='tra')throw reportRefusal(path,error);
await move(fresh,'imp','',target);
}
}