@raevon/n8n-nodes-whatsapp 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,6 @@ exports.getServerUrl = getServerUrl;
40
40
  exports.ensureServerRunning = ensureServerRunning;
41
41
  exports.disconnect = disconnect;
42
42
  exports.getWhatsAppCredentials = getWhatsAppCredentials;
43
- const node_child_process_1 = require("node:child_process");
44
43
  const node_path_1 = __importDefault(require("node:path"));
45
44
  const node_fs_1 = __importDefault(require("node:fs"));
46
45
  const node_net_1 = __importDefault(require("node:net"));
@@ -345,27 +344,21 @@ async function startServer(cfg) {
345
344
  }
346
345
  async function ensureServerRunning(cfg) {
347
346
  const port = getPort(cfg);
348
- // Check if server is already running on this port
347
+ // Port is free start server
349
348
  if (await isPortOpen(port)) {
350
- // Port is in use - check if it's our server by hitting /health
351
- try {
352
- const res = await fetch(`http://127.0.0.1:${port}/health`);
353
- if (res.ok) {
354
- // Server is alive and responding
355
- return;
356
- }
357
- }
358
- catch { }
359
- // Port is in use but not responding - kill the stale process
360
- try {
361
- const pid = (0, node_child_process_1.execSync)(`lsof -ti:${port}`, { encoding: 'utf-8' }).trim();
362
- if (pid)
363
- (0, node_child_process_1.execSync)(`kill -9 ${pid}`);
364
- await new Promise(r => setTimeout(r, 1000)); // Wait for port to release
365
- }
366
- catch { }
349
+ await startServer(cfg);
350
+ return;
351
+ }
352
+ // Port is in use — server already running, just verify it responds
353
+ try {
354
+ const res = await fetch(`http://127.0.0.1:${port}/health`, { signal: AbortSignal.timeout(3000) });
355
+ if (res.ok)
356
+ return; // Server alive, use it
367
357
  }
368
- await startServer(cfg);
358
+ catch { }
359
+ // Port in use but not responding — this is a stale/zombie process we can't kill
360
+ // Don't try to start another server, just report the issue
361
+ throw new Error(`Port ${port} is in use but server not responding. Restart n8n to clear stale processes.`);
369
362
  }
370
363
  async function disconnect() { }
371
364
  async function getWhatsAppCredentials(credentials) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raevon/n8n-nodes-whatsapp",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "n8n community node for WhatsApp — send and receive messages with anti-ban protection via the Baileys library",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",