The folder automation re-admitted a file every minute when the user had removed its jobs while a hoster was still missing, because nothing recorded the removal. Removing automatic jobs (selected, all, per hoster or through MCP) now stores the file path and identity in automation-dismissals.json. The automation skips such files until the file changes or the user adds it manually again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13178512bf
commit
f64fe23019
8 files changed
+176
-11
No files matched your search
+1
-1
@@ -109,7 +109,7 @@ export default [
|
|||||||
'getUiLocale', 'config', 'hosterSettings', 'ensureAccountStatusEntries', 'syncSelectedUploadHosters', 'renderAccounts', 'renderHosterSummary',
|
'getUiLocale', 'config', 'hosterSettings', 'ensureAccountStatusEntries', 'syncSelectedUploadHosters', 'renderAccounts', 'renderHosterSummary',
|
||||||
'rebuildJobIndex', '_queueStatsCache', 'syncSelectedFilesFromQueue', 'renderQueueTable', 'updateUploadView', 'updateStatusBar', 'queueJobs',
|
'rebuildJobIndex', '_queueStatsCache', 'syncSelectedFilesFromQueue', 'renderQueueTable', 'updateUploadView', 'updateStatusBar', 'queueJobs',
|
||||||
'uploading', 'selectedFiles', 'findAccountById', 'accountStatuses', 'existingImportPaths', 'createAutomationPreviewJob', 'clearDedupKeysForPaths',
|
'uploading', 'selectedFiles', 'findAccountById', 'accountStatuses', 'existingImportPaths', 'createAutomationPreviewJob', 'clearDedupKeysForPaths',
|
||||||
'persistQueueStateNow', 'isStartableQueueStatus', 'startSelectedUpload', '_jobIndexByUploadId', '_deletedJobIds', 'removeJobFromIndex', 'showCopyToast', 'getSelectedHosters', 'cancelStartupQueueAutoStart', '_cancelAutoRetry'
|
'persistQueueStateNow', 'isStartableQueueStatus', 'startSelectedUpload', '_jobIndexByUploadId', '_deletedJobIds', 'removeJobFromIndex', 'dismissRemovedAutomationJobs', 'showCopyToast', 'getSelectedHosters', 'cancelStartupQueueAutoStart', '_cancelAutoRetry'
|
||||||
].map(name => [name, 'writable']))
|
].map(name => [name, 'writable']))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -211,6 +211,56 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizeAutomationDismissal(value) {
|
||||||
|
const row = asObject(value);
|
||||||
|
const path = String(row.path || '').trim();
|
||||||
|
const fileIdentity = typeof row.fileIdentity === 'string' ? row.fileIdentity.trim() : '';
|
||||||
|
const dismissedAt = Number(row.dismissedAt);
|
||||||
|
if (!path || !fileIdentity) return null;
|
||||||
|
return { path, fileIdentity, dismissedAt: Number.isFinite(dismissedAt) && dismissedAt >= 0 ? Math.trunc(dismissedAt) : 0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
function mergeAutomationDismissals(existing, incoming, maxEntries = 5000) {
|
||||||
|
const merged = new Map();
|
||||||
|
for (const source of [asArray(existing), asArray(incoming)]) {
|
||||||
|
for (const value of source) {
|
||||||
|
const row = normalizeAutomationDismissal(value);
|
||||||
|
if (!row) continue;
|
||||||
|
const key = normalizePath(row.path);
|
||||||
|
merged.delete(key);
|
||||||
|
merged.set(key, row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const limit = Number.isFinite(Number(maxEntries)) ? Math.max(1, Math.floor(Number(maxEntries))) : 5000;
|
||||||
|
const rows = [...merged.values()];
|
||||||
|
return rows.slice(Math.max(0, rows.length - limit));
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeAutomationDismissals(existing, paths) {
|
||||||
|
const removed = new Set(asArray(paths).map(normalizePath).filter(Boolean));
|
||||||
|
return mergeAutomationDismissals(existing, []).filter(row => !removed.has(normalizePath(row.path)));
|
||||||
|
}
|
||||||
|
|
||||||
|
function automationDismissalsForRemovedJobs(jobs, now = Date.now()) {
|
||||||
|
return mergeAutomationDismissals([], asArray(jobs)
|
||||||
|
.filter(job => job && job.automationAdmission === true && job.status !== 'done')
|
||||||
|
.map(job => ({ path: job.file, fileIdentity: job.sourceFileIdentity, dismissedAt: now })));
|
||||||
|
}
|
||||||
|
|
||||||
|
function classifyAutomationDismissals(input = {}) {
|
||||||
|
const value = asObject(input);
|
||||||
|
const rows = new Map(mergeAutomationDismissals(value.dismissals, []).map(row => [normalizePath(row.path), row]));
|
||||||
|
const dismissedPaths = [];
|
||||||
|
const stalePaths = [];
|
||||||
|
for (const candidate of asArray(value.candidates)) {
|
||||||
|
const row = rows.get(normalizePath(candidate?.path));
|
||||||
|
if (!row || typeof candidate.fileIdentity !== 'string' || !candidate.fileIdentity) continue;
|
||||||
|
if (candidate.fileIdentity === row.fileIdentity) dismissedPaths.push(candidate.path);
|
||||||
|
else stalePaths.push(row.path);
|
||||||
|
}
|
||||||
|
return { dismissedPaths, stalePaths };
|
||||||
|
}
|
||||||
|
|
||||||
function classifyAutomationCompletionLedger(input = {}) {
|
function classifyAutomationCompletionLedger(input = {}) {
|
||||||
const value = asObject(input);
|
const value = asObject(input);
|
||||||
const rows = new Map();
|
const rows = new Map();
|
||||||
@@ -341,6 +391,11 @@
|
|||||||
createAutomationCompletionWriter,
|
createAutomationCompletionWriter,
|
||||||
normalizeAutomationCompletion,
|
normalizeAutomationCompletion,
|
||||||
mergeAutomationCompletions,
|
mergeAutomationCompletions,
|
||||||
removeAutomationCompletions
|
removeAutomationCompletions,
|
||||||
|
normalizeAutomationDismissal,
|
||||||
|
mergeAutomationDismissals,
|
||||||
|
removeAutomationDismissals,
|
||||||
|
automationDismissalsForRemovedJobs,
|
||||||
|
classifyAutomationDismissals
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
+50
-1
@@ -2,7 +2,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const secretStore = require('./secret-store');
|
const secretStore = require('./secret-store');
|
||||||
const { normalizeLogMode } = require('./log-mode');
|
const { normalizeLogMode } = require('./log-mode');
|
||||||
const { mergeAutomationCompletions, normalizeAutomationCompletion, removeAutomationCompletions } = require('./automation-control');
|
const { mergeAutomationCompletions, normalizeAutomationCompletion, removeAutomationCompletions, mergeAutomationDismissals, removeAutomationDismissals } = require('./automation-control');
|
||||||
|
|
||||||
const TRANSIENT_RENAME_ERROR_CODES = new Set(['EPERM', 'EBUSY', 'EACCES']);
|
const TRANSIENT_RENAME_ERROR_CODES = new Set(['EPERM', 'EBUSY', 'EACCES']);
|
||||||
const RENAME_RETRY_DELAYS_MS = [50, 100, 200, 400, 800, 1600, 3200];
|
const RENAME_RETRY_DELAYS_MS = [50, 100, 200, 400, 800, 1600, 3200];
|
||||||
@@ -188,6 +188,9 @@ class ConfigStore {
|
|||||||
this.filePath = path.join(dir, 'electron-config.json');
|
this.filePath = path.join(dir, 'electron-config.json');
|
||||||
this.historyPath = path.join(dir, 'electron-history.json');
|
this.historyPath = path.join(dir, 'electron-history.json');
|
||||||
this.automationCompletionPath = path.join(dir, 'automation-completions.json');
|
this.automationCompletionPath = path.join(dir, 'automation-completions.json');
|
||||||
|
this.automationDismissalPath = path.join(dir, 'automation-dismissals.json');
|
||||||
|
this._automationDismissalWriteQueue = Promise.resolve();
|
||||||
|
this._automationDismissalCache = null;
|
||||||
this._writeQueue = Promise.resolve(); // Serializes all writes to prevent race conditions
|
this._writeQueue = Promise.resolve(); // Serializes all writes to prevent race conditions
|
||||||
this._historyWriteQueue = Promise.resolve();
|
this._historyWriteQueue = Promise.resolve();
|
||||||
this._automationCompletionWriteQueue = Promise.resolve();
|
this._automationCompletionWriteQueue = Promise.resolve();
|
||||||
@@ -768,6 +771,52 @@ class ConfigStore {
|
|||||||
await this._automationCompletionWriteQueue;
|
await this._automationCompletionWriteQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _readAutomationDismissalFile() {
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(await fs.promises.readFile(this.automationDismissalPath, 'utf8'));
|
||||||
|
return mergeAutomationDismissals([], parsed && parsed.entries);
|
||||||
|
} catch (error) {
|
||||||
|
if (error?.code === 'ENOENT') return [];
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async _writeAutomationDismissalFile(entries) {
|
||||||
|
const target = this.automationDismissalPath;
|
||||||
|
const temporary = `${target}.tmp`;
|
||||||
|
await fs.promises.mkdir(path.dirname(target), { recursive: true });
|
||||||
|
await fs.promises.writeFile(temporary, JSON.stringify({ version: 1, entries }), 'utf8');
|
||||||
|
await this._renameWithRetry(temporary, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
_updateAutomationDismissals(update) {
|
||||||
|
const result = this._automationDismissalWriteQueue.then(async () => {
|
||||||
|
const current = this._automationDismissalCache || await this._readAutomationDismissalFile();
|
||||||
|
const next = update(current);
|
||||||
|
await this._writeAutomationDismissalFile(next);
|
||||||
|
this._automationDismissalCache = next;
|
||||||
|
return this._clone(next);
|
||||||
|
});
|
||||||
|
this._automationDismissalWriteQueue = result.catch(() => {});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
async loadAutomationDismissals() {
|
||||||
|
await this._automationDismissalWriteQueue;
|
||||||
|
if (!this._automationDismissalCache) this._automationDismissalCache = await this._readAutomationDismissalFile();
|
||||||
|
return this._clone(this._automationDismissalCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
addAutomationDismissals(entries) {
|
||||||
|
const incoming = this._clone(Array.isArray(entries) ? entries : []);
|
||||||
|
return this._updateAutomationDismissals(current => mergeAutomationDismissals(current, incoming));
|
||||||
|
}
|
||||||
|
|
||||||
|
removeAutomationDismissals(paths) {
|
||||||
|
const removed = Array.isArray(paths) ? paths.map(String) : [];
|
||||||
|
return this._updateAutomationDismissals(current => removeAutomationDismissals(current, removed));
|
||||||
|
}
|
||||||
|
|
||||||
saveLastBrowseDirectory(directory) {
|
saveLastBrowseDirectory(directory) {
|
||||||
const snapshot = String(directory || '').trim();
|
const snapshot = String(directory || '').trim();
|
||||||
return this._enqueueWrite(async () => {
|
return this._enqueueWrite(async () => {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const { UploadStatistics } = require('./lib/upload-statistics');
|
|||||||
const { createCollectors } = require('./lib/diagnostics-collectors');
|
const { createCollectors } = require('./lib/diagnostics-collectors');
|
||||||
const { buildSessionReport, buildSessionReportCsv } = require('./lib/session-report');
|
const { buildSessionReport, buildSessionReportCsv } = require('./lib/session-report');
|
||||||
const { inspectImportEntries, inspectReadableImportPath } = require('./lib/import-preflight');
|
const { inspectImportEntries, inspectReadableImportPath } = require('./lib/import-preflight');
|
||||||
const { normalizeAutomationSettings, automationCompletionKey, createAutomationCompletionWriter, isPathWithinAutomationFolder, normalizeAutomationCompletion } = require('./lib/automation-control');
|
const { normalizeAutomationSettings, automationCompletionKey, createAutomationCompletionWriter, isPathWithinAutomationFolder, normalizeAutomationCompletion, normalizeAutomationDismissal } = require('./lib/automation-control');
|
||||||
const { McpService } = require('./lib/mcp-service');
|
const { McpService } = require('./lib/mcp-service');
|
||||||
const { createMcpApp } = require('./lib/mcp-app');
|
const { createMcpApp } = require('./lib/mcp-app');
|
||||||
const { requiresMcpConfirmation } = require('./lib/mcp-tools');
|
const { requiresMcpConfirmation } = require('./lib/mcp-tools');
|
||||||
@@ -4124,6 +4124,25 @@ ipcMain.handle('automation:record-completions', async (_event, entries) => {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('automation:get-dismissals', () => {
|
||||||
|
return configStore.loadAutomationDismissals();
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('automation:dismiss-files', async (_event, entries) => {
|
||||||
|
const source = Array.isArray(entries) ? entries.slice(0, 5000) : [];
|
||||||
|
const normalized = source.map(normalizeAutomationDismissal);
|
||||||
|
if (source.length === 0 || normalized.some(entry => !entry)) throw new Error('Entfernte Automatik-Dateien sind ungültig');
|
||||||
|
await configStore.addAutomationDismissals(normalized);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('automation:undismiss-files', async (_event, paths) => {
|
||||||
|
const source = Array.isArray(paths) ? paths.slice(0, 5000).filter(value => typeof value === 'string' && value.trim()) : [];
|
||||||
|
if (source.length === 0) return true;
|
||||||
|
await configStore.removeAutomationDismissals(source);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
ipcMain.handle('automation:pause-after-active', () => {
|
ipcMain.handle('automation:pause-after-active', () => {
|
||||||
assertConfigWriteAllowed();
|
assertConfigWriteAllowed();
|
||||||
const intent = { pausedAt: Date.now() };
|
const intent = { pausedAt: Date.now() };
|
||||||
|
|||||||
@@ -150,6 +150,9 @@ contextBridge.exposeInMainWorld('api', {
|
|||||||
automationGetStatus: () => ipcRenderer.invoke('automation:get-status'),
|
automationGetStatus: () => ipcRenderer.invoke('automation:get-status'),
|
||||||
getAutomationCompletions: () => ipcRenderer.invoke('automation:get-completions'),
|
getAutomationCompletions: () => ipcRenderer.invoke('automation:get-completions'),
|
||||||
recordAutomationCompletions: (entries) => ipcRenderer.invoke('automation:record-completions', entries),
|
recordAutomationCompletions: (entries) => ipcRenderer.invoke('automation:record-completions', entries),
|
||||||
|
getAutomationDismissals: () => ipcRenderer.invoke('automation:get-dismissals'),
|
||||||
|
dismissAutomationFiles: (entries) => ipcRenderer.invoke('automation:dismiss-files', entries),
|
||||||
|
undismissAutomationFiles: (paths) => ipcRenderer.invoke('automation:undismiss-files', paths),
|
||||||
automationPauseAfterActive: () => ipcRenderer.invoke('automation:pause-after-active'),
|
automationPauseAfterActive: () => ipcRenderer.invoke('automation:pause-after-active'),
|
||||||
automationResume: () => ipcRenderer.invoke('automation:resume'),
|
automationResume: () => ipcRenderer.invoke('automation:resume'),
|
||||||
onFolderMonitorNewFiles: (callback) => {
|
onFolderMonitorNewFiles: (callback) => {
|
||||||
|
|||||||
+42
-7
@@ -672,12 +672,13 @@ async function loadAutomationEvidenceSnapshot() {
|
|||||||
throw new Error(`${localizeUiText(label)}: ${automationErrorDetail(error)}`);
|
throw new Error(`${localizeUiText(label)}: ${automationErrorDetail(error)}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const [history, uploadLog, automationCompletions] = await Promise.all([
|
const [history, uploadLog, automationCompletions, automationDismissals] = await Promise.all([
|
||||||
readEvidence('Verlauf konnte nicht gelesen werden', () => window.api.getHistory()),
|
readEvidence('Verlauf konnte nicht gelesen werden', () => window.api.getHistory()),
|
||||||
readEvidence('Upload-Log konnte nicht gelesen werden', () => window.api.readOwnUploadLog()),
|
readEvidence('Upload-Log konnte nicht gelesen werden', () => window.api.readOwnUploadLog()),
|
||||||
readEvidence('Abschlussnachweis konnte nicht gelesen werden', () => typeof window.api.getAutomationCompletions === 'function' ? window.api.getAutomationCompletions() : Promise.resolve([]))
|
readEvidence('Abschlussnachweis konnte nicht gelesen werden', () => typeof window.api.getAutomationCompletions === 'function' ? window.api.getAutomationCompletions() : Promise.resolve([])),
|
||||||
|
readEvidence('Entfernte Automatik-Dateien konnten nicht gelesen werden', () => typeof window.api.getAutomationDismissals === 'function' ? window.api.getAutomationDismissals() : Promise.resolve([]))
|
||||||
]);
|
]);
|
||||||
return { history, uploadLog, automationCompletions };
|
return { history, uploadLog, automationCompletions, automationDismissals };
|
||||||
}
|
}
|
||||||
|
|
||||||
function invalidateAutomationEvidenceSnapshot() {
|
function invalidateAutomationEvidenceSnapshot() {
|
||||||
@@ -685,6 +686,26 @@ function invalidateAutomationEvidenceSnapshot() {
|
|||||||
automationEvidenceSnapshotCache = null;
|
automationEvidenceSnapshotCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function dismissRemovedAutomationJobs(jobs) {
|
||||||
|
const entries = window.AutomationControl.automationDismissalsForRemovedJobs(jobs);
|
||||||
|
if (entries.length === 0 || typeof window.api.dismissAutomationFiles !== 'function') return;
|
||||||
|
try {
|
||||||
|
await window.api.dismissAutomationFiles(entries);
|
||||||
|
} catch {
|
||||||
|
showCopyToast('Entfernte Automatik-Dateien konnten nicht gespeichert werden.', 7000, 'warning');
|
||||||
|
} finally {
|
||||||
|
invalidateAutomationEvidenceSnapshot();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function undismissAutomationFiles(paths) {
|
||||||
|
const list = (Array.isArray(paths) ? paths : []).filter(Boolean);
|
||||||
|
if (list.length === 0 || typeof window.api.undismissAutomationFiles !== 'function') return Promise.resolve();
|
||||||
|
return window.api.undismissAutomationFiles(list)
|
||||||
|
.catch(() => {})
|
||||||
|
.finally(() => invalidateAutomationEvidenceSnapshot());
|
||||||
|
}
|
||||||
|
|
||||||
async function loadReusableAutomationEvidenceSnapshot() {
|
async function loadReusableAutomationEvidenceSnapshot() {
|
||||||
const now = performance.now();
|
const now = performance.now();
|
||||||
if (automationEvidenceSnapshotCache?.expiresAt > now) return automationEvidenceSnapshotCache.value;
|
if (automationEvidenceSnapshotCache?.expiresAt > now) return automationEvidenceSnapshotCache.value;
|
||||||
@@ -722,7 +743,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
|
|||||||
const selectedHosters = Array.from(new Set((Array.isArray(options.selectedHosters) ? options.selectedHosters : folderSettings.hosters || [])
|
const selectedHosters = Array.from(new Set((Array.isArray(options.selectedHosters) ? options.selectedHosters : folderSettings.hosters || [])
|
||||||
.map(value => String(value || '').trim())
|
.map(value => String(value || '').trim())
|
||||||
.filter(Boolean)));
|
.filter(Boolean)));
|
||||||
const { history, uploadLog, automationCompletions } = options.evidenceSnapshot || await loadAutomationEvidenceSnapshot();
|
const { history, uploadLog, automationCompletions, automationDismissals } = options.evidenceSnapshot || await loadAutomationEvidenceSnapshot();
|
||||||
const inspection = await window.api.inspectImportFiles(
|
const inspection = await window.api.inspectImportFiles(
|
||||||
matched,
|
matched,
|
||||||
_pendingFiles.filter(file => !ownedPendingPaths.has(normalizeAutomationPath(file.path))).map(file => file.path)
|
_pendingFiles.filter(file => !ownedPendingPaths.has(normalizeAutomationPath(file.path))).map(file => file.path)
|
||||||
@@ -743,6 +764,15 @@ async function evaluateAutomationCandidates(files, options = {}) {
|
|||||||
});
|
});
|
||||||
const processedPaths = new Set(processed.processedPaths.map(normalizeAutomationPath));
|
const processedPaths = new Set(processed.processedPaths.map(normalizeAutomationPath));
|
||||||
for (const path of processedPaths) reasons.set(path, processed.reasons[path] || 'processed');
|
for (const path of processedPaths) reasons.set(path, processed.reasons[path] || 'processed');
|
||||||
|
const dismissalState = window.AutomationControl.classifyAutomationDismissals({
|
||||||
|
candidates: inspectedCandidates.filter(candidate => !currentPaths.has(normalizeAutomationPath(candidate.path))),
|
||||||
|
dismissals: automationDismissals
|
||||||
|
});
|
||||||
|
for (const path of dismissalState.dismissedPaths.map(normalizeAutomationPath)) {
|
||||||
|
processedPaths.add(path);
|
||||||
|
reasons.set(path, 'dismissed');
|
||||||
|
}
|
||||||
|
if (dismissalState.stalePaths.length > 0 && options.dryRun !== true) undismissAutomationFiles(dismissalState.stalePaths);
|
||||||
const metadata = new Map(matched.map(candidate => [normalizeAutomationPath(candidate.path), candidate]));
|
const metadata = new Map(matched.map(candidate => [normalizeAutomationPath(candidate.path), candidate]));
|
||||||
const inspectionDuplicatePaths = new Set((Array.isArray(inspection?.duplicates) ? inspection.duplicates : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
const inspectionDuplicatePaths = new Set((Array.isArray(inspection?.duplicates) ? inspection.duplicates : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
||||||
const unavailablePaths = new Set((Array.isArray(inspection?.unavailable) ? inspection.unavailable : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
const unavailablePaths = new Set((Array.isArray(inspection?.unavailable) ? inspection.unavailable : []).map(file => normalizeAutomationPath(file?.path)).filter(Boolean));
|
||||||
@@ -813,7 +843,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
|
|||||||
name: candidate.name,
|
name: candidate.name,
|
||||||
reason: reasons.get(normalizeAutomationPath(candidate.path)) || 'unavailable'
|
reason: reasons.get(normalizeAutomationPath(candidate.path)) || 'unavailable'
|
||||||
}));
|
}));
|
||||||
const skippedReasons = new Set(['filter-rejected', 'processed', 'completion', 'history', 'upload-log', 'in-queue', 'inspection-duplicate', 'unavailable', 'size-limited']);
|
const skippedReasons = new Set(['filter-rejected', 'processed', 'completion', 'history', 'upload-log', 'in-queue', 'inspection-duplicate', 'unavailable', 'size-limited', 'dismissed']);
|
||||||
const summary = {
|
const summary = {
|
||||||
found: candidates.length,
|
found: candidates.length,
|
||||||
filterMatched: matched.length,
|
filterMatched: matched.length,
|
||||||
@@ -821,6 +851,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
|
|||||||
processedByCompletion: ledgerProcessedPaths.size,
|
processedByCompletion: ledgerProcessedPaths.size,
|
||||||
processedByHistory: classifications.filter(entry => entry.reason === 'history').length,
|
processedByHistory: classifications.filter(entry => entry.reason === 'history').length,
|
||||||
processedByUploadLog: classifications.filter(entry => entry.reason === 'upload-log').length,
|
processedByUploadLog: classifications.filter(entry => entry.reason === 'upload-log').length,
|
||||||
|
dismissedByUser: dismissalState.dismissedPaths.length,
|
||||||
inQueue: classifications.filter(entry => entry.reason === 'in-queue' || entry.reason === 'inspection-duplicate').length,
|
inQueue: classifications.filter(entry => entry.reason === 'in-queue' || entry.reason === 'inspection-duplicate').length,
|
||||||
filterRejected: classifications.filter(entry => entry.reason === 'filter-rejected').length,
|
filterRejected: classifications.filter(entry => entry.reason === 'filter-rejected').length,
|
||||||
unavailable: unavailablePaths.size,
|
unavailable: unavailablePaths.size,
|
||||||
@@ -831,7 +862,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
|
|||||||
availableSlots,
|
availableSlots,
|
||||||
deferredFiles: deferredFiles.length
|
deferredFiles: deferredFiles.length
|
||||||
};
|
};
|
||||||
if (options.dryRun !== true) window.api.debugLog(`automation-eval trigger=${String(options.trigger || 'watcher')} found=${summary.found} admitted=${admittedFiles.length} completion=${summary.processedByCompletion} history=${summary.processedByHistory} log=${summary.processedByUploadLog} queue=${summary.inQueue} filter=${summary.filterRejected} unavailable=${summary.unavailable} sizeLimitedJobs=${summary.sizeLimitedJobs} deferred=${summary.deferredFiles}`);
|
if (options.dryRun !== true) window.api.debugLog(`automation-eval trigger=${String(options.trigger || 'watcher')} found=${summary.found} admitted=${admittedFiles.length} completion=${summary.processedByCompletion} history=${summary.processedByHistory} log=${summary.processedByUploadLog} dismissed=${summary.dismissedByUser} queue=${summary.inQueue} filter=${summary.filterRejected} unavailable=${summary.unavailable} sizeLimitedJobs=${summary.sizeLimitedJobs} deferred=${summary.deferredFiles}`);
|
||||||
return freezeAutomationValue({
|
return freezeAutomationValue({
|
||||||
dryRun: options.dryRun === true,
|
dryRun: options.dryRun === true,
|
||||||
trigger: String(options.trigger || 'watcher'),
|
trigger: String(options.trigger || 'watcher'),
|
||||||
@@ -970,7 +1001,7 @@ async function applyAutomationEvaluation(evaluation) {
|
|||||||
const classifications = (evaluation.classifications || []).map(entry => dynamicPaths.has(normalizeAutomationPath(entry.path))
|
const classifications = (evaluation.classifications || []).map(entry => dynamicPaths.has(normalizeAutomationPath(entry.path))
|
||||||
? { ...entry, reason: dynamicReasons.get(normalizeAutomationPath(entry.path)) }
|
? { ...entry, reason: dynamicReasons.get(normalizeAutomationPath(entry.path)) }
|
||||||
: entry);
|
: entry);
|
||||||
const skippedReasons = new Set(['filter-rejected', 'processed', 'completion', 'history', 'upload-log', 'in-queue', 'inspection-duplicate', 'unavailable', 'size-limited']);
|
const skippedReasons = new Set(['filter-rejected', 'processed', 'completion', 'history', 'upload-log', 'in-queue', 'inspection-duplicate', 'unavailable', 'size-limited', 'dismissed']);
|
||||||
const telemetryDelta = {
|
const telemetryDelta = {
|
||||||
detected: classifications.length,
|
detected: classifications.length,
|
||||||
queued: admittedFiles.length,
|
queued: admittedFiles.length,
|
||||||
@@ -2739,6 +2770,7 @@ function coordinateImportEntries(entries, options = {}) {
|
|||||||
}
|
}
|
||||||
const acceptedPaths = new Set(inspection.accepted.map(file => file.path));
|
const acceptedPaths = new Set(inspection.accepted.map(file => file.path));
|
||||||
clearDedupKeysForPaths(acceptedPaths);
|
clearDedupKeysForPaths(acceptedPaths);
|
||||||
|
if (typeof options.folderMonitorAutoStart !== 'boolean') undismissAutomationFiles([...acceptedPaths]);
|
||||||
_pendingFiles.push(...inspection.accepted);
|
_pendingFiles.push(...inspection.accepted);
|
||||||
if (document.getElementById('hosterModal')?.style.display === 'flex') renderHosterModal();
|
if (document.getElementById('hosterModal')?.style.display === 'flex') renderHosterModal();
|
||||||
else openHosterModal();
|
else openHosterModal();
|
||||||
@@ -4516,6 +4548,7 @@ async function handleContextAction(action, targetJobId = null) {
|
|||||||
return j && (j.status === 'uploading' || j.status === 'queued' || j.status === 'retrying' || j.status === 'getting-server');
|
return j && (j.status === 'uploading' || j.status === 'queued' || j.status === 'retrying' || j.status === 'getting-server');
|
||||||
});
|
});
|
||||||
if (activeIds.length > 0) await window.api.cancelSelectedJobs(activeIds);
|
if (activeIds.length > 0) await window.api.cancelSelectedJobs(activeIds);
|
||||||
|
await dismissRemovedAutomationJobs(queueJobs.filter(j => selectedJobIds.has(j.id)));
|
||||||
const _deletedKeys = [];
|
const _deletedKeys = [];
|
||||||
queueJobs = queueJobs.filter(j => {
|
queueJobs = queueJobs.filter(j => {
|
||||||
if (selectedJobIds.has(j.id)) {
|
if (selectedJobIds.has(j.id)) {
|
||||||
@@ -4543,6 +4576,7 @@ async function handleContextAction(action, targetJobId = null) {
|
|||||||
await window.api.cancelUpload();
|
await window.api.cancelUpload();
|
||||||
uploading = false;
|
uploading = false;
|
||||||
}
|
}
|
||||||
|
await dismissRemovedAutomationJobs(queueJobs);
|
||||||
queueJobs.forEach(j => removeJobFromIndex(j));
|
queueJobs.forEach(j => removeJobFromIndex(j));
|
||||||
queueJobs = [];
|
queueJobs = [];
|
||||||
selectedJobIds.clear();
|
selectedJobIds.clear();
|
||||||
@@ -4565,6 +4599,7 @@ async function handleContextAction(action, targetJobId = null) {
|
|||||||
.filter(j => j.hoster === hoster && (j.status === 'uploading' || j.status === 'queued' || j.status === 'retrying' || j.status === 'getting-server' || j.status === 'preview'))
|
.filter(j => j.hoster === hoster && (j.status === 'uploading' || j.status === 'queued' || j.status === 'retrying' || j.status === 'getting-server' || j.status === 'preview'))
|
||||||
.map(j => j.id);
|
.map(j => j.id);
|
||||||
if (activeIds.length > 0) await window.api.cancelSelectedJobs(activeIds);
|
if (activeIds.length > 0) await window.api.cancelSelectedJobs(activeIds);
|
||||||
|
await dismissRemovedAutomationJobs(queueJobs.filter(j => j.hoster === hoster));
|
||||||
// Remove ALL jobs for this hoster
|
// Remove ALL jobs for this hoster
|
||||||
queueJobs = queueJobs.filter(j => {
|
queueJobs = queueJobs.filter(j => {
|
||||||
if (j.hoster === hoster) { removeJobFromIndex(j); return false; }
|
if (j.hoster === hoster) { removeJobFromIndex(j); return false; }
|
||||||
|
|||||||
@@ -967,6 +967,9 @@
|
|||||||
['Automatik-Abschlussdatei enthält zu viele Einträge', 'Automation completion file contains too many entries'],
|
['Automatik-Abschlussdatei enthält zu viele Einträge', 'Automation completion file contains too many entries'],
|
||||||
['Automatik-Abschlussnachweise sind ungültig', 'Automation completion evidence is invalid'],
|
['Automatik-Abschlussnachweise sind ungültig', 'Automation completion evidence is invalid'],
|
||||||
['Abschlussnachweise konnten nicht gespeichert werden.', 'Completion evidence could not be saved.'],
|
['Abschlussnachweise konnten nicht gespeichert werden.', 'Completion evidence could not be saved.'],
|
||||||
|
['Entfernte Automatik-Dateien konnten nicht gespeichert werden.', 'Removed automation files could not be saved.'],
|
||||||
|
['Entfernte Automatik-Dateien konnten nicht gelesen werden', 'Removed automation files could not be read'],
|
||||||
|
['Entfernte Automatik-Dateien sind ungültig', 'Removed automation files are invalid'],
|
||||||
['Abschlussnachweise konnten nicht vollständig ermittelt werden.', 'Completion evidence could not be determined completely.'],
|
['Abschlussnachweise konnten nicht vollständig ermittelt werden.', 'Completion evidence could not be determined completely.'],
|
||||||
['Automatische Wiederaufnahme wurde wegen nicht verfügbarer Abschlussnachweise blockiert.', 'Automatic resume was blocked because completion evidence is unavailable.'],
|
['Automatische Wiederaufnahme wurde wegen nicht verfügbarer Abschlussnachweise blockiert.', 'Automatic resume was blocked because completion evidence is unavailable.'],
|
||||||
['Upload-Log-Verzeichnis enthält zu viele Einträge', 'Upload log directory contains too many entries'],
|
['Upload-Log-Verzeichnis enthält zu viele Einträge', 'Upload log directory contains too many entries'],
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
const jobs = select(args);
|
const jobs = select(args);
|
||||||
if (jobs.some(job => !['preview', 'done', 'error', 'skipped', 'aborted'].includes(job.status))) throw new Error('CANCEL_ACTIVE_JOBS_FIRST');
|
if (jobs.some(job => !['preview', 'done', 'error', 'skipped', 'aborted'].includes(job.status))) throw new Error('CANCEL_ACTIVE_JOBS_FIRST');
|
||||||
await guard();
|
await guard();
|
||||||
|
await dismissRemovedAutomationJobs(jobs);
|
||||||
const ids = new Set(jobs.map(job => job.id));
|
const ids = new Set(jobs.map(job => job.id));
|
||||||
jobs.forEach(job => removeJobFromIndex(job)); queueJobs = queueJobs.filter(job => !ids.has(job.id));
|
jobs.forEach(job => removeJobFromIndex(job)); queueJobs = queueJobs.filter(job => !ids.has(job.id));
|
||||||
redraw(); await persistQueueStateNow(); return { removed: jobs.length };
|
redraw(); await persistQueueStateNow(); return { removed: jobs.length };
|
||||||
|
|||||||
Reference in new issue
Block a user