fix: the page waits while the antivirus restarts instead of showing its English reason (DTF-WEB-2F)
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Successful in 9m2s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m15s
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Successful in 9m2s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m15s
At 19:22 a customer read "Malware scanner unavailable; file remains blocked": the scan answered "error" (the antivirus not answering, likely restarting with the deploy), and the page treated it as final, while the worker scans an "error" file again a minute later (app/scanning.py). The page now keeps waiting through "error", within the same budget as a pending scan; only "rejected" stops at once, with its reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -210,6 +210,22 @@ const run = async (completeSteps, {abortAfter} = {}) => {
|
|||||||
const waits = delays.filter(d => d === 1000 || d === 5000);
|
const waits = delays.filter(d => d === 1000 || d === 5000);
|
||||||
assert.ok(waits.filter(d => d === 1000).length === 150 && waits.includes(5000));
|
assert.ok(waits.filter(d => d === 1000).length === 150 && waits.includes(5000));
|
||||||
}
|
}
|
||||||
|
// The antivirus not answering (a deploy restarting it) is scanned again by the
|
||||||
|
// worker a minute later: the page waits through it (Sentry DTF-WEB-2F).
|
||||||
|
{
|
||||||
|
scanStates = Array(70).fill('error');
|
||||||
|
const {result, error} = await run([{}]);
|
||||||
|
assert.equal(error, undefined);
|
||||||
|
assert.equal(result, 'u1');
|
||||||
|
scanStates = [];
|
||||||
|
}
|
||||||
|
// A refused file stops at once, with the server's reason.
|
||||||
|
{
|
||||||
|
scanStates = ['pending', 'rejected'];
|
||||||
|
const {error} = await run([{}]);
|
||||||
|
assert.match(error?.message || '', /bloqueado pela verificação/);
|
||||||
|
scanStates = [];
|
||||||
|
}
|
||||||
// A scan the server never finishes ends with the message, after its 15 minutes.
|
// A scan the server never finishes ends with the message, after its 15 minutes.
|
||||||
{
|
{
|
||||||
scanStates = Array(5000).fill('pending');
|
scanStates = Array(5000).fill('pending');
|
||||||
|
|||||||
@@ -81,7 +81,11 @@ async function sendUpload(file, {api, prefix='/uploads', startPath=prefix, progr
|
|||||||
if(signal?.aborted)throw cancelled();
|
if(signal?.aborted)throw cancelled();
|
||||||
const checked=await api(prefix+'/'+id);
|
const checked=await api(prefix+'/'+id);
|
||||||
if(checked.scan_state==='clean')return id;
|
if(checked.scan_state==='clean')return id;
|
||||||
if(['rejected','error'].includes(checked.scan_state))throw new Error(checked.scan_reason||'Arquivo bloqueado pela verificação de segurança.');
|
if(checked.scan_state==='rejected')throw new Error(checked.scan_reason||'Arquivo bloqueado pela verificação de segurança.');
|
||||||
|
// "error" is the antivirus not answering (restarting with a deploy):
|
||||||
|
// the worker scans the file again a minute later (app/scanning.py), so
|
||||||
|
// the page keeps waiting instead of showing the scanner's English
|
||||||
|
// reason (Sentry DTF-WEB-2F).
|
||||||
progress('Verificando segurança de '+file.name+'…');
|
progress('Verificando segurança de '+file.name+'…');
|
||||||
const pause=waited<150000?1000:5000;
|
const pause=waited<150000?1000:5000;
|
||||||
await new Promise(resolve=>setTimeout(resolve,pause));
|
await new Promise(resolve=>setTimeout(resolve,pause));
|
||||||
|
|||||||
Reference in New Issue
Block a user