Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): show the real default in the Browser Arguments field

Yudhi Armyndharis7eb2f253e58d
diff --git a/dashboard/src/pages/Infrastructure.test.ts b/dashboard/src/pages/Infrastructure.test.ts
index 37d09c522..b89d36a31 100644
--- a/dashboard/src/pages/Infrastructure.test.ts
+++ b/dashboard/src/pages/Infrastructure.test.ts
@@ -8,6 +8,7 @@
// RoleProvider (harmless here, kept for parity with App.tsx) → ToastProvider (useToast throws
// without it). No Router — the page uses no router hooks.
import '../test-helpers/register-hooks.ts';
+import { readFileSync } from 'node:fs';
import { test, before, afterEach } from 'node:test';
import assert from 'node:assert/strict';
import { createElement } from 'react';
@@ -285,6 +286,18 @@ test('Infrastructure renders and the config form hydrates from /status and /conf
});
});
+// An empty field saves the gateway's DEFAULT_PUPPETEER_ARGS, so the placeholder must name that list: an
+// operator who copies a shorter one drops flags such as the /dev/shm crash guard.
+test('the Browser Arguments placeholder is the default an empty field saves', async () => {
+ const source = readFileSync(new URL('../../../src/config/configuration.ts', import.meta.url), 'utf8');
+ const list = /DEFAULT_PUPPETEER_ARGS[^=]*=\s*\[([^\]]*)\]/.exec(source)?.[1];
+ assert.ok(list, 'DEFAULT_PUPPETEER_ARGS not found');
+ const defaults = [...list.matchAll(/'([^']+)'/g)].map(m => m[1]).join(' ');
+ const { container } = renderInfrastructure();
+ await rtl.screen.findByText('Database Configuration');
+ assert.equal(fieldInput(container, 'Browser Arguments').placeholder, defaults);
+});
+
// The detail fields (username, database, schema, bucket, engine options) come only from /config.
// Rendered without it, the form holds its built-in defaults, and a Save would write them over the
// stored external database, S3 and engine settings.
diff --git a/dashboard/src/pages/Infrastructure.tsx b/dashboard/src/pages/Infrastructure.tsx
index ec0b68997..dc8ace95a 100644
--- a/dashboard/src/pages/Infrastructure.tsx
+++ b/dashboard/src/pages/Infrastructure.tsx
@@ -487,7 +487,7 @@ export function Infrastructure() {
type="text"
value={configForm.engineConfig.browserArgs}
onChange={e => configForm.updateEngineConfig('browserArgs', e.target.value)}
- placeholder="--no-sandbox --disable-gpu"
+ placeholder="--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage --disable-gpu"
/>
{pinNote('PUPPETEER_ARGS')}
</div>