Closed Exanlv closed 1 year ago
28b74163d6e23e5761b106f666b34b45d80e856b
Issue is caused by a timeout when connecting
[2023-03-30T23:44:36.030533+00:00] stability-bot.INFO: Gateway: Cancelled scheduled reconnect [] []
[2023-03-30T23:45:17.220237+00:00] stability-bot.INFO: WS(C->S): {"op":1,"d":21} [] []
[2023-03-30T23:45:17.220396+00:00] stability-bot.INFO: Gateway: Scheduled reconnect [] []
[2023-03-30T23:45:17.320331+00:00] stability-bot.INFO: WS(S->C): {"t":null,"s":null,"op":11,"d":null} [] []
[2023-03-30T23:45:17.320552+00:00] stability-bot.INFO: Gateway: Cancelled scheduled reconnect [] []
[2023-03-30T23:45:58.511199+00:00] stability-bot.INFO: WS(C->S): {"op":1,"d":21} [] []
[2023-03-30T23:45:58.511421+00:00] stability-bot.INFO: Gateway: Scheduled reconnect [] []
[2023-03-30T23:46:03.516594+00:00] stability-bot.INFO: Gateway: attempting reconnect [] []
[2023-03-30T23:46:03.516765+00:00] stability-bot.INFO: Gateway: Stopped heartbeats [] []
[2023-03-30T23:46:03.516831+00:00] stability-bot.INFO: WS (C->S): Closing connection: code = 1001, reason = $s [] []
[2023-03-30T23:46:03.516974+00:00] stability-bot.INFO: WS (C->S): Connecting to wss://gateway-us-east1-b.discord.gg [] []
[2023-03-30T23:46:13.524549+00:00] stability-bot.INFO: WS (C->S): Error connecting to wss://gateway-us-east1-b.discord.gg. Connection to tls://gateway-us-east1-b.discord.gg:443 timed out after 10 seconds (ETIMEDOUT) [] []
When this happens, a new connection should be established with the default wss url
Fix should:
In the refactor branch, following error occurs
PHP Fatal error: Uncaught Error: Typed property Ragnarok\Fenrir\Gateway\Connection::$reconnectUrl must not be accessed before initialization in /usr/src/fenrir-stability/vendor/exan/fenrir/src/Gateway/Connection.php:106
Stack trace:
#0 /usr/src/fenrir-stability/vendor/exan/fenrir/src/Gateway/Connection.php(148): Ragnarok\Fenrir\Gateway\Connection->reconnect()
#1 /usr/src/fenrir-stability/vendor/react/event-loop/src/Timer/Timers.php(101): Ragnarok\Fenrir\Gateway\Connection->Ragnarok\Fenrir\Gateway\{closure}()
#2 /usr/src/fenrir-stability/vendor/react/event-loop/src/StreamSelectLoop.php(185): React\EventLoop\Timer\Timers->tick()
#3 /usr/src/fenrir-stability/vendor/react/event-loop/src/Loop.php(55): React\EventLoop\StreamSelectLoop->run()
#4 [internal function]: React\EventLoop\Loop::React\EventLoop\{closure}()
#5 {main}
thrown in /usr/src/fenrir-stability/vendor/exan/fenrir/src/Gateway/Connection.php on line 106
Looks like the lib doesn't reconnect to Discord after a missed heartbeat ack.