Commit 0bbf270
Don't close the queue while a watcher swap is in flight
A rebuild spliced the old cleanups out of `cleanupWatchers` and only pushed the
new generation back after awaiting them. If stdin closed inside that window,
shutdown saw an empty list, resolved immediately and closed the queue — so the
files the old generation flushed on its way out were pushed into a closed queue
and ignored, and the process exited 0 with stale CSS.
Register the new generation before awaiting the old one, so the list is never
empty, and track the in-flight swap so shutdown waits for it before closing.
The ordering now lives in `shutdownWatchMode` so it can be asserted directly:
the queue must still be open while a swap is flushing. Against the previous
ordering that assertion fails — the queue is already closed and the flush has
not landed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lcj4iQ3fBxMwAu2rf4zLbC1 parent d346922 commit 0bbf270
2 files changed
Lines changed: 58 additions & 11 deletions
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
330 | 334 | | |
331 | 335 | | |
332 | 336 | | |
| |||
409 | 413 | | |
410 | 414 | | |
411 | 415 | | |
412 | | - | |
| 416 | + | |
| 417 | + | |
413 | 418 | | |
414 | | - | |
415 | | - | |
416 | | - | |
| 419 | + | |
417 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
418 | 424 | | |
419 | 425 | | |
420 | 426 | | |
| |||
509 | 515 | | |
510 | 516 | | |
511 | 517 | | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
518 | 522 | | |
519 | 523 | | |
520 | 524 | | |
| |||
706 | 710 | | |
707 | 711 | | |
708 | 712 | | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
709 | 730 | | |
710 | 731 | | |
711 | 732 | | |
| |||
0 commit comments