phoenix
phoenix copied to clipboard
mix phx.routes shows wrong socket information for (nth) endpoint, n > 1
trafficstars
Environment
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Elixir 1.12.0 (compiled with Erlang/OTP 24)
phoenix 1.5.9 (Hex package) (mix)
Steps to reproduce.
mix phx.new yolo
cp lib/yolo_web/endpoint.ex lib/yolo_web/endpoint2.ex
cp lib/yolo_web/router.ex lib/yolo_web/router2.ex
edit modules to be YoloWeb.Endpoint2 and YoloWeb.Router2
edit YoloWeb.Endpoint2 module to have plug YoloWeb.Router2 at the bottom
comment out sockets from YoloWeb.Endpoint2
comment out livedashboard stuff from both routers.
Expected behavior
mix phx.routes YoloWeb.Router2 shows no sockets:
page_path GET / YoloWeb.PageController :index
Actual behavior
mix phx.routes YoloWeb.Router2 shows socket information from YoloWeb.Endpoint:
page_path GET / YoloWeb.PageController :index
websocket WS /live/websocket Phoenix.LiveView.Socket
longpoll GET /live/longpoll Phoenix.LiveView.Socket
longpoll POST /live/longpoll Phoenix.LiveView.Socket
websocket WS /socket/websocket YoloWeb.UserSocket
Note
the reverse works, too. Commenting out socket information from YoloWeb.Endpoint and keeping in YoloWeb.Endpoint2 results in no sockets shown on YoloWeb.Endpoint2