fix: preserve rotation logs during quit fallback

Route synchronous account-rotation shutdown flushes through the internal log writer so failures under userData/logs retry userData/internal-logs in the same order as runtime writes.

Keep buffered lines until a target accepts the full chunk, report the successful fallback as the active path, and retain the buffer when every internal target fails.

Cover the real EISDIR primary-path case, complete fallback failure, and main-process quit delegation without launching Electron.
This commit is contained in:
Sucukdeluxe
2026-08-26 12:37:17 +02:00
parent d4f47b955a
commit 28a475401e
3 changed files with 80 additions and 3 deletions
+1 -2
View File
@@ -1785,8 +1785,7 @@ app.on('will-quit', () => {
} catch {}
try {
if (_rotLogBuffer.length) {
fs.appendFileSync(getRotLogPath(), _rotLogBuffer.join(''), 'utf-8');
_rotLogBuffer.length = 0;
_rotLogWriter.flushSync(_rotLogBuffer, 'rot-log');
}
} catch {}
});