git-watchtower 1.14.4 → 1.14.5

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.
@@ -1958,6 +1958,8 @@ async function pollGitChanges() {
1958
1958
  lastPrStatusFetch = Date.now();
1959
1959
  prStatusFetchInFlight = false;
1960
1960
  }).catch(() => {
1961
+ // gh/glab errored (unauthed, rate-limited, network). PR indicators
1962
+ // keep their last-known state; the next poll tick will retry.
1961
1963
  prStatusFetchInFlight = false;
1962
1964
  });
1963
1965
  }
@@ -2862,6 +2864,8 @@ function setupKeyboardInput() {
2862
2864
  render();
2863
2865
  }
2864
2866
  }).catch(() => {
2867
+ // Async enrichment failed (no remote, gh/glab errored, etc.).
2868
+ // Drop the spinner so the modal shows what we have from phase 1.
2865
2869
  if (store.get('actionMode') && store.get('actionData') && store.get('actionData').branch.name === branch.name) {
2866
2870
  store.setState({ actionLoading: false });
2867
2871
  render();
@@ -3534,6 +3538,23 @@ process.on('uncaughtException', async (err) => {
3534
3538
  process.exit(1);
3535
3539
  });
3536
3540
 
3541
+ // Mirror of uncaughtException for unhandled promise rejections. Without this,
3542
+ // Node 15+ crashes the process on a missed .catch() tail with no telemetry
3543
+ // and no terminal restore — leaving the TUI user in a broken terminal. Also
3544
+ // high-signal: an unhandled rejection reaching here means we missed a .catch()
3545
+ // somewhere and telemetry will tell us where.
3546
+ process.on('unhandledRejection', async (reason) => {
3547
+ isShuttingDown = true;
3548
+
3549
+ cleanupResources();
3550
+
3551
+ const err = reason instanceof Error ? reason : new Error(String(reason));
3552
+ try { telemetry.captureError(err); } catch (_) { /* telemetry must never prevent crash cleanup */ }
3553
+ console.error('Unhandled rejection:', reason);
3554
+ try { await telemetry.shutdown(); } catch (_) { /* telemetry must never prevent crash cleanup */ }
3555
+ process.exit(1);
3556
+ });
3557
+
3537
3558
  // ============================================================================
3538
3559
  // Startup
3539
3560
  // ============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.14.4",
3
+ "version": "1.14.5",
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": {