fix(server): guard paseo:ready IPC behind PASEO_SUPERVISED env var

The process.send check alone was insufficient because vitest also runs
workers with IPC channels. Now the supervisor sets PASEO_SUPERVISED=1
on the worker env, and bootstrap checks for it before sending.
This commit is contained in:
Mohamed Boudra
2026-03-30 12:44:05 +07:00
parent f6630e16ff
commit e0e4f228eb
2 changed files with 2 additions and 2 deletions
@@ -76,7 +76,7 @@ async function main(): Promise<void> {
const config = parseConfig(process.argv.slice(2));
const workerEntry = config.devMode ? resolveDevWorkerEntry() : resolveWorkerEntry();
const workerExecArgv = resolveWorkerExecArgv(workerEntry);
const workerEnv: NodeJS.ProcessEnv = { ...process.env };
const workerEnv: NodeJS.ProcessEnv = { ...process.env, PASEO_SUPERVISED: "1" };
const packagedNodeEntrypointRunner =
process.env.ELECTRON_RUN_AS_NODE === "1"
? resolvePackagedNodeEntrypointRunnerPath(fileURLToPath(import.meta.url))
+1 -1
View File
@@ -691,7 +691,7 @@ export async function createPaseoDaemon(
);
}
if (typeof process.send === "function") {
if (typeof process.send === "function" && process.env.PASEO_SUPERVISED === "1") {
process.send({
type: "paseo:ready",
listen: