Add CloudDrop log backfill and clear connection status
CI / verify (push) Canceled after 0s

This commit is contained in:
Sucukdeluxe committed 2026-10-15 12:57:26 +02:00
1 parent 63abaa819c
commit 63296e7ad3
7 files changed
+226 -19

No files matched your search

+13
View File
@@ -2060,6 +2060,19 @@ ipcMain.handle('cloud-log:configure', async (event, payload = {}) => {
}
});
ipcMain.handle('cloud-log:backfill', async event => {
if (!isTrustedOnlineBackupIpcEvent(event)) return { ok: false, errorCode: 'ACCESS_DENIED' };
assertConfigWriteAllowed();
try {
await Promise.all([...cloudLogWrites]);
const result = await cloudLogSync.backfill(_cachedUploadLogTarget?.path || getLogFilePath());
return { ok: true, result, status: cloudLogSync.status() };
} catch (error) {
const allowed = ['CONNECTION_REQUIRED', 'LOG_NOT_FOUND', 'LOG_READ_FAILED', 'LOG_TOO_LARGE', 'LOCAL_WRITE_FAILED', 'BACKFILL_CANCELED'];
return { ok: false, errorCode: allowed.includes(error?.code) ? error.code : 'LOG_READ_FAILED', status: cloudLogSync.status() };
}
});
ipcMain.handle('save-config', async (_event, config) => {
assertConfigWriteAllowed();
if (config?.globalSettings) config.globalSettings.cloudLogSync = configStore.load().globalSettings.cloudLogSync;