git-watchtower 1.14.3 → 1.14.4

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.
@@ -2207,7 +2207,12 @@ function createStaticServer() {
2207
2207
  let realStaticDir;
2208
2208
  try {
2209
2209
  realStaticDir = fs.realpathSync(resolvedStaticDir);
2210
- } catch {
2210
+ } catch (e) {
2211
+ // STATIC_DIR comes from our own package layout, so a realpath failure
2212
+ // means the install is broken (missing dir, permissions, etc.) — worth
2213
+ // diagnosing. Fall back to the unresolved path so the request still
2214
+ // gets its 403 rather than crashing.
2215
+ telemetry.captureError(e);
2211
2216
  realStaticDir = resolvedStaticDir;
2212
2217
  }
2213
2218
  if (!resolvedPath.startsWith(realStaticDir + path.sep) && resolvedPath !== realStaticDir) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.14.3",
3
+ "version": "1.14.4",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {
@@ -20,6 +20,7 @@ const fs = require('fs');
20
20
  const path = require('path');
21
21
  const os = require('os');
22
22
  const crypto = require('crypto');
23
+ const telemetry = require('../telemetry');
23
24
 
24
25
  /**
25
26
  * Directory for watchtower runtime files
@@ -359,7 +360,12 @@ class Coordinator {
359
360
  try {
360
361
  const msg = JSON.parse(line);
361
362
  this._handleWorkerMessage(socket, msg, (id) => { workerId = id; }, () => workerId);
362
- } catch (e) { /* malformed IPC frame from worker — skip it and keep reading */ }
363
+ } catch (e) {
364
+ // Both sides of this socket are our own code, so a JSON-parse
365
+ // failure indicates a protocol/version bug worth diagnosing.
366
+ telemetry.captureError(e);
367
+ /* skip malformed frame and keep reading */
368
+ }
363
369
  }
364
370
  }
365
371
  });
@@ -517,7 +523,12 @@ class Worker {
517
523
  try {
518
524
  const msg = JSON.parse(line);
519
525
  this._handleMessage(msg);
520
- } catch (e) { /* malformed IPC frame from coordinator — skip it and keep reading */ }
526
+ } catch (e) {
527
+ // Both sides of this socket are our own code, so a JSON-parse
528
+ // failure indicates a protocol/version bug worth diagnosing.
529
+ telemetry.captureError(e);
530
+ /* skip malformed frame and keep reading */
531
+ }
521
532
  }
522
533
  }
523
534
  });