Harden upload lifecycle and renderer recovery

Serialize upload starts across durable audit work, drain in-flight batch additions before cleanup, and fail closed when recovery persistence is incomplete. Wire bounded renderer reload recovery with a branded localized failure surface and use merge-safe fallback log persistence.
This commit is contained in:
Sucukdeluxe
2026-08-13 21:11:48 +02:00
parent 4c48044a95
commit 3ced148ee8
7 changed files with 252 additions and 82 deletions
+11
View File
@@ -8,6 +8,16 @@ function resolveStartupLanguage(config) {
return config && config.globalSettings && config.globalSettings.language === 'de' ? 'de' : 'en';
}
function createStartupFailureDocument(language) {
const german = language === 'de';
const title = german ? 'Oberfläche konnte nicht geladen werden' : 'The interface could not load';
const detail = german
? 'Multi Hoster Uploader konnte die Oberfläche nach einem sicheren Wiederherstellungsversuch nicht laden.'
: 'Multi Hoster Uploader could not load the interface after a safe recovery attempt.';
const close = german ? 'Schließen' : 'Close';
return `<!doctype html><html lang="${german ? 'de' : 'en'}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Multi Hoster Uploader</title><style>html,body{height:100%;margin:0;background:#1f1f1f;color:#f4f4f4;font:15px system-ui,sans-serif}body{display:grid;place-items:center}.card{width:min(520px,calc(100% - 48px));padding:28px;border:1px solid #444;border-radius:12px;background:#292929;box-shadow:0 18px 50px #0008}h1{margin:0 0 12px;font-size:22px}p{margin:0 0 22px;color:#c8c8c8;line-height:1.5}button{min-height:38px;padding:0 18px;border:1px solid #555;border-radius:7px;background:#363636;color:#fff;font-weight:650;cursor:pointer}button:hover{background:#414141}</style></head><body><main class="card"><h1>${title}</h1><p>${detail}</p><button type="button" onclick="window.close()">${close}</button></main></body></html>`;
}
function createStartupRecoveryCoordinator({ load, reload, reveal, showFailure, close }) {
let initialLoad;
let crashReloads = 0;
@@ -86,6 +96,7 @@ function createStartupWindow(BrowserWindow, options) {
module.exports = {
configureStartupRenderer,
createStartupFailureDocument,
createStartupRecoveryCoordinator,
createStartupWindow,
resolveStartupLanguage