Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

test(desktop): retain renderer diagnostics during official upgrade verification (#776)

tianma-if5aa10475236e
diff --git a/scripts/verify-native-release-bridge.mjs b/scripts/verify-native-release-bridge.mjs
index 46ceb731..2657e809 100644
--- a/scripts/verify-native-release-bridge.mjs
+++ b/scripts/verify-native-release-bridge.mjs
@@ -110,6 +110,13 @@ const launch = async (update) => {
const req = process.getBuiltinModule('module').createRequire(process.resourcesPath + '/app.asar/package.json');
const { app, net, dialog } = req('electron');
app.isInApplicationsFolder = () => true;
+ app.on('web-contents-created', (_event, contents) => {
+ contents.on('console-message', (...args) => {
+ const details = args.find(value => value && typeof value === 'object' && typeof value.message === 'string');
+ const message = details?.message ?? args.filter(value => typeof value === 'string').join(' ');
+ req('node:fs').appendFileSync(${JSON.stringify(join(evidence, update ? "old-renderer.jsonl" : "new-renderer.jsonl"))}, JSON.stringify({message}) + '\\n');
+ });
+ });
app.setPath('userData', ${JSON.stringify(profile)});
req('node:fs').writeFileSync(${JSON.stringify(join(evidence, update ? "old-version.json" : "new-version.json"))}, JSON.stringify({version: app.getVersion(), executable: process.execPath}));
if (${JSON.stringify(update)}) {