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
+22
View File
@@ -5,11 +5,33 @@ const fs = require('node:fs');
const path = require('node:path');
const {
configureStartupRenderer,
createStartupFailureDocument,
createStartupRecoveryCoordinator,
createStartupWindow,
resolveStartupLanguage
} = require('../lib/startup-renderer');
test('startup failure document is a localized visible application surface', () => {
const english = createStartupFailureDocument('en');
const german = createStartupFailureDocument('de');
assert.match(english, /Multi Hoster Uploader/);
assert.match(english, /could not load/);
assert.match(english, /Close/);
assert.match(german, /konnte nicht geladen werden/);
assert.match(german, /Schließen/);
assert.doesNotMatch(english, /Electron/);
});
test('main process wires bounded startup recovery into real load and crash paths', () => {
const source = fs.readFileSync(path.join(__dirname, '..', 'main.js'), 'utf8');
assert.match(source, /createStartupRecoveryCoordinator/);
assert.match(source, /startupRecoveryCoordinator\.loadInitial/);
assert.match(source, /startupRecoveryCoordinator\.rendererCrashed/);
assert.match(source, /startupRecoveryCoordinator\.rendererReady/);
assert.match(source, /createStartupFailureDocument/);
});
class TestBrowserWindow extends EventEmitter {
constructor(options) {
super();