From 0e7b6eb019791d9744fd4d6d6640f01c06d85657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 16 Nov 2026 16:58:27 -0300 Subject: [PATCH] fix: an ended session or a server restart no longer shows the folders' pass as an error (DTF-WEB-N) 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) --- web/kanban.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/kanban.js b/web/kanban.js index b576663..dbae459 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -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.';