Skip to content

Commit

Permalink
fix: fixed a long standing bug that recently made itself known
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishtyaq K committed Dec 20, 2024
1 parent 45c670b commit b092c97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/server/lib/app/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ defmodule App.User do
Logger.info("(#{user.id}): creating lobby")
with lobby
<- %App.Lobby.Schema{} |> DB.insert!(),
{:ok, {:global, lobby_id}}
{:ok, lobby_id}
<- App.Supervisor.Lobbies.start_lobby(lobby) do
Logger.info("(u#{user.id}): created lobby (#{lobby_id})")
GenServer.reply(from, lobby_id)
else
e -> GenServer.reply(from, {:error, "failed to create lobby #{inspect(e)}"})
end
end

Expand Down
5 changes: 3 additions & 2 deletions src/server/lib/app_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ defmodule AppWeb.Router do
end
# ---
defp resp_actor(conn, actor) do
Logger.debug("(router): #{inspect(conn.body_params)}")
try do
resp_actor!(conn,actor)
rescue
Expand All @@ -53,9 +54,9 @@ defmodule AppWeb.Router do

defp resp_actor!(conn, actor) do
with {:ok, msg} <- parse_req_msg(conn),
reply <- unwrap!(GenServer.call(actor, msg, :infinity))
reply <- unwrap!(GenServer.call(actor, msg))
do
Logger.debug("(router): #{inspect(msg)}")
Logger.debug("(router): #{inspect(msg)}")
Logger.debug("(router): #{inspect(reply)}")
conn
|> put_resp_content_type("application/json")
Expand Down

0 comments on commit b092c97

Please sign in to comment.