nterminal 1.2.24 → 1.2.25

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nterminal",
3
- "version": "1.2.24",
3
+ "version": "1.2.25",
4
4
  "license": "GPL-3.0-only",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.7",
@@ -518,30 +518,6 @@ wait_for_health() {
518
518
  return 1
519
519
  }
520
520
 
521
- restart_supervised_child() {
522
- local monitor_pid="$1"
523
- local old_pid="${2:-}"
524
-
525
- if [[ -n "$old_pid" ]]; then
526
- stop_supervised_child "$old_pid"
527
- fi
528
-
529
- local pid=""
530
- local deadline=$((SECONDS + HEALTH_TIMEOUT_SECONDS))
531
- while (( SECONDS <= deadline )); do
532
- if ! is_running "$monitor_pid"; then
533
- return 1
534
- fi
535
- pid="$(current_pid || true)"
536
- if [[ -n "$pid" && "$pid" != "$old_pid" ]] && wait_for_health "$pid"; then
537
- info "NTerminal restarted pid=$pid supervisor=$monitor_pid url=$(public_url) log=$LOG_PATH"
538
- return 0
539
- fi
540
- sleep 0.25
541
- done
542
- return 1
543
- }
544
-
545
521
  port_owner_pid() {
546
522
  if command -v lsof >/dev/null 2>&1; then
547
523
  lsof -nP -iTCP:"$PORT" -sTCP:LISTEN -t 2>/dev/null | head -n 1
@@ -707,21 +683,11 @@ cmd_restart() {
707
683
  start_launchd
708
684
  else
709
685
  prepare_start
710
- remove_stale_pid
711
- remove_stale_monitor_pid
712
- local monitor_pid
713
- monitor_pid="$(current_monitor_pid || true)"
714
- if [[ -n "$monitor_pid" ]]; then
715
- local pid
716
- pid="$(current_pid || true)"
717
- if restart_supervised_child "$monitor_pid" "$pid"; then
718
- return 0
719
- fi
720
- echo "NTerminal failed to restart under supervisor. Last log lines:" >&2
721
- tail -n 40 "$LOG_PATH" >&2 || true
722
- return 1
723
- fi
724
- cmd_stop >/dev/null
686
+ # Replace the supervisor instead of only restarting its child. The
687
+ # supervisor keeps its original environment, so reusing it after onboarding
688
+ # or npm replacement can restart the server with stale .env values or old
689
+ # package code.
690
+ cmd_stop >/dev/null || true
725
691
  cmd_start
726
692
  fi
727
693
  info "NTerminal restarted"