Handle coroutine join cancellation and wait for child cleanup
Coroutine::join() now throws CanceledException whenever the caller is canceled during the wait. Previously, one of Swoole's cancellation modes returned false, and checking the coroutine's cancellation flag could pick up an earlier canceled wait. Timeouts and joins where every child had already exited still return false. Passing the same child ID twice waits for that child to exit.
Use Coroutine::joinUninterruptibly() when a child needs to finish cleaning up before its caller can release a resource. If the caller is canceled, it keeps waiting until the children exit or the original timeout expires, then throws the first cancellation. Repeated cancellations don't extend the deadline.
The gRPC client now waits for its receiver before closing the transport, and prompts wait for an in-flight render before restoring the terminal. A callback error can no longer hide a cancellation during prompt cleanup. Strict child cleanup uses the same wait, and the existing PHPStan cancellation checks recognize it.
The Passport device-code test now allows for time spent between issuing the code and sending the response.
[!NOTE]
Handle join cancellation and wait for child cleanup with joinUninterruptibly
Coroutine.join now retries a failed native join with distinct IDs when repeated IDs cause a wrong-operation error, and throws CanceledException when the wait is canceled
- Adds
Coroutine.joinUninterruptibly, which keeps waiting through caller cancellations (with an optional timeout) until children exit, then throws the first cancellation; callers like Waiter.php, Connection.php, and PromptAnimation.php use it to guarantee child cleanup before propagating cancellation
Parallel.wait and Waiter.wait now rely on the CanceledException thrown by Coroutine.join instead of inspecting engine cancellation state after a false join result
- Prompt components (
Progress, Prompt, Spinner, Task) prefer cancellation over earlier failures during cleanup via Coroutine.preferCancellation
- The PHPStan
SwallowedCancellationCollector and CoroutineRuleHelper classify joinUninterruptibly as a wait operation
- Behavioral Change:
Coroutine.join can now throw CanceledException where it previously returned false; Prompt.prompt no longer suppresses terminal-restoration failures when an operation failure exists
Macroscope summarized e7b56ae.