fix: prevent folder-monitor reuploads after completion

Discover base, daily, session, and fallback upload logs across configured, Desktop, and application-data locations without blocking the Electron main process.

Treat in-session completion keys as authoritative automation evidence so removing finished rows cannot cause periodic reconciliation to enqueue and upload the same file again.

Add real handler and done-remove-reconcile regressions covering custom extensions, mixed-case log names, fallback paths, stale evidence, and asynchronous log reads.
This commit is contained in:
Sucukdeluxe
2026-08-27 13:22:35 +02:00
parent c0153acfb2
commit 58b92856a6
6 changed files with 182 additions and 27 deletions
+5 -1
View File
@@ -599,9 +599,13 @@ async function evaluateAutomationCandidates(files, options = {}) {
.map(value => String(value || '').trim())
.filter(Boolean)));
const { history, uploadLog } = options.evidenceSnapshot || await loadAutomationEvidenceSnapshot();
const completedPaths = [..._completedUploadKeys].map(key => {
const separator = key.lastIndexOf('|');
return separator > 0 ? key.slice(0, separator) : '';
}).filter(Boolean);
const processed = window.AutomationControl.classifyProcessedCandidates({
candidates: matched,
queuePaths: [...queueJobs.map(job => job.file), ...selectedFiles.map(file => file.path)],
queuePaths: [...queueJobs.map(job => job.file), ...selectedFiles.map(file => file.path), ...completedPaths],
historyRows: flattenAutomationHistoryRows(history),
uploadLogRows: uploadLog
});