Skip to content

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

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

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

Conversation

@jrauh01
Copy link
Copy Markdown

@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

requires:

@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
@lippserd lippserd added this to the v1.12.0 milestone Mar 25, 2026
@lippserd lippserd force-pushed the upgrade-react-promise branch from c2e9489 to bdd16ad Compare March 26, 2026 12:01
@raviks789 raviks789 force-pushed the upgrade-react-promise branch from bdd16ad to 022918f Compare March 30, 2026 09:30
Comment thread library/Director/Daemon/DbBasedComponent.php Outdated
jrauh01 added 8 commits April 7, 2026 07:34
`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 force-pushed the upgrade-react-promise branch from 022918f to 1a9a08e Compare April 7, 2026 05:39
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.

3 participants