fix: an ended session or a server restart no longer shows the folders' pass as an error (DTF-WEB-N)
Some checks failed
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Failing after 5m49s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Has been skipped

After 8 hours the session ends and the 30 s folders pass got "Entre no
Kanban." (401), reported in red and so to Sentry. A 401 or the restart's
503 now ends the pass quietly, since load() already shows the sign-in,
and no pass runs while the sign-in is showing. Real folder failures stay
red.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-16 16:58:27 -03:00
parent 8cc35c100f
commit 0e7b6eb019

View File

@@ -513,7 +513,7 @@ async function syncHot(step){
// board load it asks only when something it follows changed; the folder's
// own timer always asks, since another computer may have moved the order.
async function syncFolder(force=false){
if(!folderActive()||FOLDER.busy||!board||!may('print'))return;
if(!folderActive()||FOLDER.busy||!board||!may('print')||$('app').hidden)return;
// One tab per computer writes the folders: two tabs writing the same file
// lock each other out. The other tabs skip the pass.
if(navigator.locks&&!force?.held)return navigator.locks.request('dtf-folders',{ifAvailable:true},
@@ -628,6 +628,9 @@ async function syncFolder(force=false){
else if(locked.some(name=>FOLDER.locked.get(name)===1))say('Pastas automáticas: '+FOLDER.error);
}
}catch(e){
// The session ended (8 h) or the server is restarting: load() already shows
// the sign-in, and the folders resume after it (Sentry DTF-WEB-N).
if(e.status===401||e.status===503){FOLDER.status='';return;}
if(e.name==='NotAllowedError')FOLDER.granted=false;
else if(e.name==='NotFoundError')FOLDER.error='A pasta “'+FOLDER.handle?.name+'” não foi encontrada. Ela foi apagada ou a rede caiu? Escolha a pasta de novo.';
else FOLDER.error='A última tentativa falhou: '+e.message+' O Kanban tenta de novo sozinho.';