From c192458efe1d6ea0ad500ffccdc5f50c27bf95eb Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 3 Oct 2024 13:37:33 +0100 Subject: [PATCH] Setup Sentry for LiveView error tracking --- lib/music_library_web.ex | 2 ++ lib/music_library_web/endpoint.ex | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/music_library_web.ex b/lib/music_library_web.ex index f4335dfb..d2bedb2c 100644 --- a/lib/music_library_web.ex +++ b/lib/music_library_web.ex @@ -55,6 +55,8 @@ defmodule MusicLibraryWeb do use Phoenix.LiveView, layout: {MusicLibraryWeb.Layouts, :app} + on_mount Sentry.LiveViewHook + unquote(html_helpers()) end end diff --git a/lib/music_library_web/endpoint.ex b/lib/music_library_web/endpoint.ex index d781a59d..799941ff 100644 --- a/lib/music_library_web/endpoint.ex +++ b/lib/music_library_web/endpoint.ex @@ -13,8 +13,8 @@ defmodule MusicLibraryWeb.Endpoint do ] socket "/live", Phoenix.LiveView.Socket, - websocket: [connect_info: [session: @session_options]], - longpoll: [connect_info: [session: @session_options]] + websocket: [connect_info: [:peer_data, :uri, :user_agent, session: @session_options]], + longpoll: [connect_info: [:peer_data, :uri, :user_agent, session: @session_options]] # Serve at "/" the static files from "priv/static" directory. #