From d68ccd6ec8e3d1f9b24b5ab55f417ad85d32fd13 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Fri, 11 Sep 2026 16:55:25 -0400 Subject: [PATCH] Fix D-Bus transport on Bare --- daemon/dbus-service.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon/dbus-service.js b/daemon/dbus-service.js index c2b8832..e15a8ab 100644 --- a/daemon/dbus-service.js +++ b/daemon/dbus-service.js @@ -7,6 +7,13 @@ export async function serveOnSessionBus(daemon) { // its builtin imports use bare-* implementations where supported. const { createRequire } = await import('node:module'); const require = createRequire(import.meta.url); + // dbus-next enables TCP_NODELAY on every transport. Bare's Unix-pipe + // transport exposes the Node-compatible method on the wrapper, but its + // underlying pipe does not implement the native socket operation. D-Bus is + // request/response traffic, so disabling this optional optimization keeps + // the transport functional without changing message semantics. + const net = require('node:net', { with: { imports: 'bare-node-runtime/imports' } }); + if (net.Socket?.prototype) net.Socket.prototype.setNoDelay = function setNoDelay() { return this; }; const dbus = require('dbus-next', { with: { imports: 'bare-node-runtime/imports' } }); const { Interface } = dbus.interface; class Session extends Interface {