Closed ellisonpatterson closed 1 year ago
It is already fixed in dev-master / v10 but not in v7.x because the react loop was never a direct dependency and react making this breaking change from a 1.1 to a 1.2 which is not a major version, suppose i fix this by locking to react loop 1.1 but if the dependency was never there it means doing so is a breaking change and requires bump to major version. So this was not mistake on our side.
Solution: dont use Loop::get(), avoid the static call, store and pass your loop object instead or use $discord->getLoop().
I will probably set loop to null in 7.4.x (not as a fix) but requires user to explicitly set Loop in their options, which is not really breaking change if they have react/loop 1.2+ installed already
Edit: I might detect for the new Loop class exists in the react loop to detect if user has <1.1 or >1.2
Fixed in 7.3.3 6d76ad8fbf320e97304f6d04cc9f5894e2fed023
I already was passing in a loop I created without the static helper, but it was still overriding it.
Thank you for the quick fix!
Environment
Describe the bug In the initialization for the event loop, you are calling
\React\EventLoop\Factory::create()
which overwrites the custom loop one can set in the configuration. Using this method is also deprecated as the notes list. https://github.com/reactphp/event-loop/blob/3992edd97694303260ac87b85f86ff45cc92feea/src/Factory.php#L13-L41It needs to be changed from using
\React\EventLoop\Factory::create()
to\React\EventLoop\Loop::get()
so a second loop isn't created by DiscordPHP.To Reproduce Steps to reproduce the behavior:
This outputs that the loop I passed in was overwritten: