MaxDac / Stygian

Stygian GDR
0 stars 0 forks source link

Investigate error in Presence while returning from dice thrower #44

Open MaxDac opened 1 year ago

MaxDac commented 1 year ago
** (FunctionClauseError) no function clause matching in StygianWeb.Presence.map_onlines/1
    (stygian_web 0.1.0) lib/stygian_web/presence.ex:87: StygianWeb.Presence.map_onlines({"1", [%{character: %{avatar: "/images/TheNameless.png", id: 1, name: "The Nameless", user: %{id: 1, name: "ghostLayer"}}, map: %{id: 8, is_chat: true, name: "Abandoned Hotel"}, phx_ref: "F3qf4ChbyfPing-E"}, %{character: %{avatar: "/images/TheNameless.png", id: 1, name: "The Nameless", user: %{id: 1, name: "ghostLayer"}}, map: %{id: nil, is_chat: false, name: "Mappa principale"}, phx_ref: "F3qf4ChfcDving-k"}]})
    (elixir 1.15.4) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
    (stygian_web 0.1.0) lib/stygian_web/presence.ex:60: StygianWeb.Presence.map_presences/1
    (stygian_web 0.1.0) lib/stygian_web/presence.ex:46: StygianWeb.Presence.handle_metas/4
    (phoenix 1.7.7) lib/phoenix/presence.ex:587: anonymous fn/2 in Phoenix.Presence.do_handle_metas/2
    (elixir 1.15.4) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix 1.7.7) lib/phoenix/presence.ex:520: Phoenix.Presence.handle_info/2
    (phoenix_pubsub 2.1.3) lib/phoenix/tracker/shard.ex:223: Phoenix.Tracker.Shard.handle_info/2
    (stdlib 4.3.1.2) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.3.1.2) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.3.1.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {#Reference<0.3510163188.3920429060.60921>, {:phoenix, #Reference<0.3510163188.3920363524.60916>, [{"user_activity", %{joins: %{"1" => %{metas: [%{character: %{avatar: "/images/TheNameless.png", id: 1, name: "The Nameless", user: %{id: 1, name: "ghostLayer"}}, map: %{id: nil, is_chat: false, name: "Mappa principale"}, phx_ref: "F3qf4ChfcDving-k"}]}}, leaves: %{}}}]}}
State: %{broadcast_period: 1500, clock_sample_periods: 2, current_sample_count: 2, deltas: [], down_period: 30000, log_level: false, max_delta_sizes: [100, 1000, 10000], max_silent_periods: 10, namespaced_topic: "phx_presence:Elixir.StygianWeb.Presence_shard0", pending_clockset: [], permdown_period: 1200000, presences: %Phoenix.Tracker.State{replica: {:nonode@nohost, 1691840393153920}, context: %{{:nonode@nohost, 1691840393153920} => 2}, clouds: %{{:nonode@nohost, 1691840393153920} => MapSet.new([{{:nonode@nohost, 1691840393153920}, 1}, {{:nonode@nohost, 1691840393153920}, 2}])}, values: StygianWeb.Presence_shard0, pids: #Reference<0.3510163188.3920494594.116717>, mode: :normal, delta: %Phoenix.Tracker.State{replica: {:nonode@nohost, 1691840393153920}, context: %{}, clouds: %{{:nonode@nohost, 1691840393153920} => MapSet.new([{{:nonode@nohost, 1691840393153920}, 1}, {{:nonode@nohost, 1691840393153920}, 2}])}, values: %{{{:nonode@nohost, 1691840393153920}, 1} => {#PID<0.1486.0>, "user_activity", 1, %{character: %{avatar: "/images/TheNameless.png", id: 1, name: "The Nameless", user: %{id: 1, name: "ghostLayer"}}, map: %{id: 8, is_chat: true, name: "Abandoned Hotel"}, phx_ref: "F3qf4ChbyfPing-E"}}, {{:nonode@nohost, 1691840393153920}, 2} => {#PID<0.1487.0>, "user_activity", 1, %{character: %{avatar: "/images/TheNameless.png", id: 1, name: "The Nameless", user: %{id: 1, name: "ghostLayer"}}, map: %{id: nil, is_chat: false, name: "Mappa principale"}, phx_ref: "F3qf4ChfcDving-k"}}}, pids: nil, mode: :delta, delta: :unset, replicas: %{}, range: {%{{:nonode@nohost, 1691840393153920} => 0}, %{{:nonode@nohost, 1691840393153920} => 2}}}, replicas: %{{:nonode@nohost, 1691840393153920} => :up}, range: {%{}, %{}}}, pubsub_server: StygianWeb.PubSub, replica: %Phoenix.Tracker.Replica{name: :nonode@nohost, vsn: 1691840393153920, last_heartbeat_at: nil, status: :up}, replicas: %{}, report_events_to: nil, shard_name: StygianWeb.Presence_shard0, silent_periods: 1, tracker: Phoenix.Presence.Tracker, tracker_state: %{client_state: %{}, current_task: {#Reference<0.3510163188.3920363524.60916>, %Task{mfa: {:erlang, :apply, 2}, owner: #PID<0.1485.0>, pid: #PID<0.1490.0>, ref: #Reference<0.3510163188.3920429060.60921>}}, module: StygianWeb.Presence, pubsub_server: StygianWeb.PubSub, task_supervisor: StygianWeb.Presence.TaskSupervisor, tasks: {[], []}, topics: %{"user_activity" => %{"1" => [%{character: %{avatar: "/images/TheNameless.png", id: 1, name: "The Nameless", user: %{id: 1, name: "ghostLayer"}}, map: %{id: 8, is_chat: true, name: "Abandoned Hotel"}, phx_ref: "F3qf4ChbyfPing-E"}]}}}}
MaxDac commented 1 year ago

Another branch added to the pattern matching in this PR #45, that will log the errors in case it happens in production.