-
Notifications
You must be signed in to change notification settings - Fork 658
Multiple Websockets routes #412
Comments
I have debugged this and there is indeed a huge bug due to the logger being a singleton and the decoration overriding the app on the singleton instance In protected function createWebSocketsServer(string $action): WsServer
{
$app = app($action);
if (WebsocketsLogger::isEnabled()) {
$app = WebsocketsLogger::decorate($app); //This is a singleton and that means calling the method multiple time will override the previous app
}
return new WsServer($app);
} The websocket logger needs to be refactored, it cannot be a singleton or it needs to encapsulate the router instead of the App. There is no way to disable the logger other than to disable the entire debug of laravel.. So no viable workaround other than to disable debug.. Which I don't want to do while developing |
#414 Correctly fixes the issue by cloning the singleton on decoration, probably not the best approach but the only fix I could come up with without refactoring the entire WebSocket logger class |
Fix multiple routes not working when Logger enabled #412
@Tofandel Indeed this was an actual problem. I have tagged 1.6.1 with this fix. |
Uh oh!
There was an error while loading. Please reload this page.
I have multiple websockets handlers and when defining the routes, I can indeed only access the defined routes the rest will return 404 but for some reason only the last defined controller is called.. (Can check by dumping on the onOpen handler)
Am I missing something or is there a huge bug there?
The text was updated successfully, but these errors were encountered: