Skip to content

Commit 17750de

Browse files
committed
chore(changeset): os serve's state-file directory; drop the round-one not-covered line it closes
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018t6a5rvqPRvEDMCVVW9kYT
1 parent b3fa3f1 commit 17750de

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): `os serve` no longer hangs after binding its port when its runtime state file's directory can never be made
6+
7+
Clause-②: no
8+
9+
**What was wrong.** Once listening, `os serve` writes its runtime state file, `runtime.<environment>.<project>.json`, into `OS_HOME` before it prints the ready banner. It made that directory with Node's recursive `mkdir`, which never returns when a level answers `ENOENT` although its parent exists, as `/proc` and `/sys` answer for a name they do not have. Under such an `OS_HOME`, with the database outside it, the server bound its port and then looped in its own process, holding the event loop: no `Press Ctrl+C to stop`, no listening message to an `os dev` parent, and no request answered.
10+
11+
**What an operator sees now.** The directory is made with the same bounded walk as the other `OS_HOME` paths, so a directory that can never be made is refused at once. The state file has always been best-effort: the boot goes on without it and prints its banner, as it already did when the file could not be written for any other reason.
12+
13+
Nothing else changes. Every state file written before is still written, in the same place, before the banner; a home that can be made is still made, every missing level of it.

‎.changeset/23858-uncreatable-directory-refusal.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@ Clause-②: no
2020
✗ Cannot create home directory at /proc/os-x: ENOENT: no such file or directory, mkdir '/proc/os-x'
2121
```
2222

23-
Not covered yet: the runtime state file `os serve` writes into `OS_HOME` once it is listening.
24-
2523
Nothing else changes. Every directory these paths made before is still made, every missing level of it; every path that was refused before is still refused, with the operating system's code. The one difference is the path that was never answered at all.

0 commit comments

Comments
 (0)