From 65a6183753c17dc6bb83f795cf5f615d816dc48f Mon Sep 17 00:00:00 2001 From: Lars Wikman Date: Sun, 25 Aug 2024 21:06:48 +0200 Subject: [PATCH] Prevent the thousands of warnings and sentry errors for the unhandled message (#1467) --- lib/nerves_hub_web/channels/device_channel.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/nerves_hub_web/channels/device_channel.ex b/lib/nerves_hub_web/channels/device_channel.ex index 3f09e2834..00eff4184 100644 --- a/lib/nerves_hub_web/channels/device_channel.ex +++ b/lib/nerves_hub_web/channels/device_channel.ex @@ -399,6 +399,11 @@ defmodule NervesHubWeb.DeviceChannel do {:noreply, socket} end + def handle_info(%Broadcast{event: "connection:heartbeat"}, socket) do + # Expected message that is not used here :) + {:noreply, socket} + end + def handle_info(msg, socket) do # Ignore unhandled messages so that it doesn't crash the link process # preventing cascading problems.