Brennan Benson and Neil
3cd23a13a1
fix(pty): keep runtime dirs a surviving daemon still uses ( #7463 )
...
The node-pty native runtime is relocated to a per-app-version dir under
userData so live terminals survive NSIS updates. On every launch,
removeStaleRuntimeVersions() deleted every *other* version's dir, gated
on a "renameSync succeeds => unused => safe to delete" heuristic.
That heuristic is false on Windows: running .exe images and mapped .dll
files are opened with FILE_SHARE_DELETE, so both the directory rename and
the recursive delete succeed while a daemon adopted across the update is
still using them. Existing PTYs keep streaming via deferred-delete
handles, but the next spawn re-loads conpty.dll from the now-unlinked
version dir and fails with ERROR_PATH_NOT_FOUND (code 3) -- the
"Cannot find conpty.dll ... error code: 3" new-tab failure.
Gate cleanup on real daemon liveness instead: collectInUseRuntimeVersions()
reads the daemon-v<N>.pid files under userData/daemon and, for each live
daemon, protects the appVersion (runtime dir) it recorded. Deletion now
skips the current version and any in-use version, dropping the rename
dance. Every failure mode leaks a dir rather than deleting one in use.
Rewrites the misleading cleanup test (which modeled no live daemon) and
adds coverage for surviving/dead daemons, appVersion:null pin files,
multiple protocol versions, and malformed/non-pid files.
Co-authored-by: Neil <neil@stably.ai >
2026-07-05 17:21:42 -07:00
..
2026-07-03 19:40:45 -04:00
2026-07-04 22:56:55 -07:00
2026-06-29 22:38:29 -07:00
2026-07-03 16:26:53 -07:00
2026-06-29 22:38:29 -07:00
2026-07-04 01:30:04 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-07-04 08:17:55 -07:00
2026-07-03 16:26:53 -07:00
2026-07-03 17:49:29 -07:00
2026-06-29 22:38:29 -07:00
2026-07-03 14:12:33 -07:00
2026-07-04 02:54:20 -07:00
2026-07-04 23:33:25 -07:00
2026-06-08 19:23:32 -04:00
2026-06-29 22:38:29 -07:00
2026-07-03 16:26:53 -07:00
2026-06-29 22:38:29 -07:00
2026-07-03 16:26:53 -07:00
2026-06-30 01:21:07 -07:00
2026-07-03 16:26:53 -07:00
2026-07-05 04:36:24 -04:00
2026-07-03 16:26:53 -07:00
2026-05-16 14:36:46 -07:00
2026-07-03 16:26:53 -07:00
2026-07-03 22:32:11 -07:00
2026-07-03 16:26:53 -07:00
2026-07-04 14:19:00 -07:00
2026-07-04 21:31:51 -07:00
2026-06-17 16:08:14 -07:00
2026-07-04 15:16:50 -07:00
2026-07-03 16:24:01 -07:00
2026-07-03 16:26:53 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 20:02:28 -07:00
2026-07-05 15:33:38 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-07-03 16:26:53 -07:00
2026-04-20 19:41:12 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 20:17:46 -07:00
2026-07-05 02:53:17 -07:00
2026-06-29 22:38:29 -07:00
2026-07-05 01:15:16 -07:00
2026-07-04 02:40:37 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 18:32:56 -07:00
2026-05-30 02:46:28 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-06-30 22:14:54 -04:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-07-05 04:36:24 -04:00
2026-07-05 17:21:42 -07:00
2026-07-05 01:15:16 -07:00
2026-07-05 04:36:24 -04:00
2026-06-28 15:43:07 -07:00
2026-06-29 22:38:29 -07:00
2026-07-03 19:43:38 -07:00
2026-05-30 13:26:48 -07:00
2026-07-04 23:54:26 -07:00
2026-06-29 22:38:29 -07:00
2026-07-04 08:20:58 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 18:09:33 -07:00
2026-06-29 22:38:29 -07:00
2026-06-18 22:30:44 -07:00
2026-06-29 22:38:29 -07:00
2026-07-05 02:53:17 -07:00
2026-06-17 16:20:37 -07:00
2026-06-17 16:20:37 -07:00
2026-05-18 14:09:21 -07:00
2026-05-18 14:09:21 -07:00
2026-05-18 14:09:21 -07:00
2026-06-17 16:08:14 -07:00
2026-06-17 16:08:14 -07:00
2026-06-22 18:01:37 -07:00
2026-06-22 18:01:37 -07:00
2026-04-19 12:09:32 -07:00
2026-05-15 23:52:37 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-06-22 13:49:08 -07:00
2026-06-22 13:49:08 -07:00
2026-05-30 15:26:11 -04:00
2026-06-29 22:38:29 -07:00
2026-06-19 17:14:55 -07:00
2026-06-29 22:38:29 -07:00
2026-06-30 11:31:55 -07:00
2026-06-30 11:31:55 -07:00
2026-07-05 12:50:27 -07:00
2026-06-29 22:38:29 -07:00
2026-05-30 09:04:52 -07:00
2026-05-30 09:04:52 -07:00
2026-06-17 16:08:14 -07:00
2026-06-29 00:53:07 -07:00
2026-06-29 00:53:07 -07:00
2026-06-28 23:23:47 -07:00
2026-06-28 23:23:47 -07:00
2026-06-29 12:27:30 -07:00
2026-06-29 12:27:30 -07:00
2026-05-30 09:04:52 -07:00
2026-05-30 09:04:52 -07:00
2026-07-03 19:40:45 -04:00
2026-07-03 19:40:45 -04:00
2026-06-24 00:17:49 -07:00
2026-06-24 00:17:49 -07:00
2026-06-17 16:08:14 -07:00
2026-06-17 16:08:14 -07:00
2026-06-24 21:07:15 -04:00
2026-06-29 22:38:29 -07:00
2026-06-18 16:24:22 -07:00
2026-06-25 17:24:09 -07:00
2026-06-24 19:19:31 -07:00
2026-06-24 19:19:31 -07:00
2026-06-24 19:19:31 -07:00
2026-07-03 19:40:45 -04:00
2026-07-03 19:40:45 -04:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-05-31 02:21:17 -07:00
2026-06-28 11:38:23 -07:00
2026-07-03 17:52:59 -07:00
2026-07-03 17:52:59 -07:00
2026-06-21 18:51:44 -07:00
2026-06-13 14:16:05 -07:00
2026-05-21 21:52:26 -07:00
2026-05-21 21:52:26 -07:00
2026-05-21 21:52:26 -07:00
2026-05-21 21:52:26 -07:00
2026-05-30 10:11:48 -07:00
2026-06-29 22:38:29 -07:00
2026-06-17 16:08:14 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-04-14 10:25:55 -07:00
2026-04-14 10:33:25 -07:00
2026-06-20 16:39:42 -07:00
2026-05-26 20:56:11 -07:00
2026-06-17 16:20:37 -07:00
2026-05-30 13:09:17 -07:00
2026-05-30 13:09:17 -07:00
2026-05-27 00:47:01 -07:00
2026-07-05 02:53:17 -07:00
2026-07-05 02:53:17 -07:00
2026-05-15 23:52:37 -07:00
2026-05-26 20:56:11 -07:00
2026-06-20 16:39:42 -07:00
2026-07-05 02:53:17 -07:00
2026-07-05 02:53:17 -07:00
2026-05-31 10:11:51 -07:00
2026-05-31 10:11:51 -07:00
2026-05-06 23:30:03 -07:00
2026-06-29 22:38:29 -07:00
2026-05-20 22:09:35 -07:00
2026-06-10 16:41:22 -04:00
2026-05-30 11:01:09 -07:00
2026-05-21 13:22:37 -07:00
2026-05-30 11:01:09 -07:00
2026-07-04 21:31:51 -07:00
2026-07-04 21:31:51 -07:00
2026-07-04 21:31:51 -07:00
2026-06-29 18:02:10 -07:00
2026-06-03 12:25:54 -07:00
2026-06-03 12:25:54 -07:00
2026-06-29 22:38:29 -07:00
2026-07-02 11:24:07 -07:00
2026-07-02 11:24:07 -07:00
2026-07-02 11:24:07 -07:00
2026-06-15 14:54:50 -07:00
2026-06-29 22:38:29 -07:00
2026-05-29 16:06:33 -07:00
2026-05-29 16:06:33 -07:00
2026-05-29 16:06:33 -07:00
2026-06-29 00:32:36 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00
2026-06-29 22:38:29 -07:00