From 5e92fb4fc6c884f2cd383766f4227e3c3aca0d16 Mon Sep 17 00:00:00 2001 From: martmull Date: Mon, 2 Mar 2026 13:04:12 +0100 Subject: [PATCH] Do not console.log while consoleListener (#18322) It can occur infinite loops see https://twenty-v7.sentry.io/issues/7269592888/?environment=prod&environment=prod-eu&project=4507072499810304&query=is%3Aunresolved%20!issue.type%3A%5Bperformance_consecutive_db_queries%2Cperformance_consecutive_http%2Cperformance_file_io_main_thread%2Cperformance_db_main_thread%2Cperformance_n_plus_one_db_queries%2Cperformance_n_plus_one_api_calls%2Cperformance_p95_endpoint_regression%2Cperformance_slow_db_query%2Cperformance_render_blocking_asset_span%2Cperformance_uncompressed_assets%2Cperformance_http_overhead%2Cperformance_large_http_payload%5D%20timesSeen%3A%3E10&referrer=issue-stream&sort=freq --- .../logic-function-drivers/drivers/local.driver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-drivers/drivers/local.driver.ts b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-drivers/drivers/local.driver.ts index ac5a17fca9..704d64c0f5 100644 --- a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-drivers/drivers/local.driver.ts +++ b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-drivers/drivers/local.driver.ts @@ -253,7 +253,7 @@ export class LocalDriver implements LogicFunctionDriver { const json = process.argv[2]; payload = json ? JSON.parse(json) : undefined; const out = await mod.${handlerName}(payload); - console.log(JSON.stringify({ ok: true, result: out })); + process.stdout.write(JSON.stringify({ ok: true, result: out })); process.exit(0); } } catch (err) { @@ -261,7 +261,7 @@ export class LocalDriver implements LogicFunctionDriver { if (process.send) { process.send({ ok: false, error: msg, stack: err?.stack }); } else { - console.error(msg); + process.stdout.write(msg); } process.exit(1); }