feat: add in-app update flow and native e2e verification (#1112)

* feat(app-update): add in-app update flow with native e2e coverage

* docs(ai-workflow): infer closed-issue labels automatically

* fix(app-update): address native updater review findings

* fix(android): validate updater redirect hosts

* fix(electron): harden updater file names
This commit is contained in:
Tommaso Casaburi
2026-03-20 13:31:52 +08:00
committed by GitHub
parent dd4451c8c5
commit 5ecf8fbea8
11 changed files with 321 additions and 42 deletions
+16 -1
View File
@@ -3,6 +3,7 @@ import http from 'node:http';
import os from 'node:os';
import path from 'node:path';
import { spawn } from 'node:child_process';
import { pipeline } from 'node:stream/promises';
import { fileURLToPath } from 'node:url';
const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
@@ -179,7 +180,19 @@ const startFixtureServer = async () => {
'Content-Type': 'application/octet-stream',
'Cache-Control': 'no-store',
});
fs.createReadStream(matchedAsset.filePath).pipe(response);
try {
await pipeline(fs.createReadStream(matchedAsset.filePath), response);
} catch (error) {
logStep(`fixture asset stream failed for ${matchedAsset.filePath}: ${error instanceof Error ? error.message : String(error)}`);
if (!response.headersSent) {
response.writeHead(500, {
'Content-Type': 'text/plain; charset=utf-8',
});
}
if (!response.writableEnded) {
response.end('asset stream failed');
}
}
return;
}
@@ -199,6 +212,8 @@ const startFixtureServer = async () => {
throw new Error('Could not resolve fixture server port');
}
logStep(`fixture server listening at http://127.0.0.1:${address.port} (android emulator: http://10.0.2.2:${address.port})`);
return {
port: address.port,
setRelease(version, assets) {