Skip to content

Upgrade react/promise to v3 and react/event-loop to v1.6#3043

Open
jrauh01 wants to merge 7 commits intomasterfrom
upgrade-react-promise
Open

Upgrade react/promise to v3 and react/event-loop to v1.6#3043
jrauh01 wants to merge 7 commits intomasterfrom
upgrade-react-promise

Conversation

@jrauh01
Copy link

@jrauh01 jrauh01 commented Mar 2, 2026

Summary

  • Upgrade react/promise to v3:
    • replace removed ExtendedPromiseInterface with PromiseInterface
    • pass required arguments to resolve() and reject()
    • rename otherwise()/always() to catch()/finally()
    • remove dead FinishedProcessState catch handler that can never trigger in v3 (because it doesn't implement the Throwable interface); gipfl\IcingaCliDaemon\IcingaCli already rejects with an Exception wrapping the process state reason
  • Upgrade react/event-loop to v1.6:
    • replace deprecated Factory::create() with Loop::get()

References

https://github.com/reactphp/promise/releases/tag/v3.0.0
https://github.com/reactphp/event-loop/releases/tag/v1.2.0

jrauh01 added 7 commits March 2, 2026 08:56
`PromiseInterface` now includes the functionality `ExtendedPromiseInterface`.
Additionally use imports instead of FQN.

Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
`reject()` now requires a `Throwable` instance as argument.

Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
Update `@var` annotation to use `PromiseInterface[]`. Remove now unused
`Promise` import from JobRunner.
`React\EventLoop\Factory` has been removed in v1.2. The replacement is
`React\EventLoop\Loop::get()` which returns a shared loop instance.

Ref: https://github.com/reactphp/event-loop/releases/tag/v1.2.0
`FinishedProcessState` does not implement `\Throwable`, so `catch(function
(FinishedProcessState $state))` can never trigger in react/promise v3 where
rejection reasons must be `\Throwable`.

This is safe to remove because `IcingaCli` already rejects with an `Exception`
wrapping the process state reason:

```php
$deferred->reject(new Exception($state->getReason()));
```

The existing `catch(\Exception $e)` handler already covers this.

Ref: https://github.com/reactphp/promise/releases/tag/v3.0.0
@jrauh01 jrauh01 self-assigned this Mar 2, 2026
@cla-bot cla-bot bot added the cla/signed label Mar 2, 2026
@jrauh01 jrauh01 requested a review from lippserd March 2, 2026 11:49
@jrauh01 jrauh01 changed the title Upgrade react/promise to **v3** and react/event-loop to **v1.6** Upgrade react/promise to v3 and react/event-loop to v1.6 Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant