Files
paseo/packages/server/src/server/test-utils/outdated-daemon-process.ts
T
Mohamed BoudraandGitHub 6aba0370ae Make remote daemon update failures actionable (#2120)
* fix(settings): show daemon update failures

React Native web ignores Alert.alert, so failed remote updates reset to an enabled button without any user-visible explanation. Keep updater progress and failure as explicit rendered state, including the daemon's error, and cover the real browser-to-daemon failure path.

* test(settings): harden daemon update regression

* fix(settings): disable Desktop-managed daemon updates

Desktop-bundled daemons advertised npm self-update even though the install-origin checks always rejected it. Report Desktop ownership to clients, render actionable guidance, and refuse stale requests before touching npm.
2026-07-16 21:04:31 +08:00

39 lines
1.0 KiB
TypeScript

import { readFile } from "node:fs/promises";
import path from "node:path";
import { createTestPaseoDaemon } from "./paseo-daemon.js";
async function main(): Promise<void> {
const metroPort = process.env.E2E_METRO_PORT;
if (!metroPort) {
throw new Error("E2E_METRO_PORT is not set");
}
const daemon = await createTestPaseoDaemon({
corsAllowedOrigins: [`http://localhost:${metroPort}`],
daemonVersion: "0.0.0",
desktopManaged: process.env.E2E_DESKTOP_MANAGED === "1",
});
const serverId = (await readFile(path.join(daemon.paseoHome, "server-id"), "utf8")).trim();
process.send?.({
type: "ready",
endpoint: `127.0.0.1:${daemon.port}`,
serverId,
});
const shutdown = async () => {
await daemon.close();
process.exit(0);
};
process.once("SIGINT", () => void shutdown());
process.once("SIGTERM", () => void shutdown());
}
void main().catch((error) => {
process.send?.({
type: "error",
error: error instanceof Error ? (error.stack ?? error.message) : String(error),
});
process.exit(1);
});