mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user