Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Remove unused socket code
Uku Taht9b0bd2162cfa
diff --git a/lib/plausible_web/channels/user_socket.ex b/lib/plausible_web/channels/user_socket.exdeleted file mode 100644index 2ec5fcba16..0000000000--- a/lib/plausible_web/channels/user_socket.ex+++ /dev/null@@ -1,33 +0,0 @@-defmodule PlausibleWeb.UserSocket do- use Phoenix.Socket-- ## Channels- # channel "room:*", PlausibleWeb.RoomChannel-- # Socket params are passed from the client and can- # be used to verify and authenticate a user. After- # verification, you can put default assigns into- # the socket that will be set for all channels, ie- #- # {:ok, assign(socket, :user_id, verified_user_id)}- #- # To deny connection, return `:error`.- #- # See `Phoenix.Token` documentation for examples in- # performing token verification on connect.- def connect(_params, socket, _connect_info) do- {:ok, socket}- end-- # Socket id's are topics that allow you to identify all sockets for a given user:- #- # def id(socket), do: "user_socket:#{socket.assigns.user_id}"- #- # Would allow you to broadcast a "disconnect" event and terminate- # all active sockets and channels for a given user:- #- # PlausibleWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{})- #- # Returning `nil` makes this socket anonymous.- def id(_socket), do: nil-enddiff --git a/lib/plausible_web/endpoint.ex b/lib/plausible_web/endpoint.exindex 124a4918cf..b66811631b 100644--- a/lib/plausible_web/endpoint.ex+++ b/lib/plausible_web/endpoint.ex@@ -2,10 +2,6 @@ defmodule PlausibleWeb.Endpoint douse Phoenix.Endpoint, otp_app: :plausibleuse Sentry.Phoenix.Endpoint- socket "/socket", PlausibleWeb.UserSocket,- websocket: true,- longpoll: false-# Serve at "/" the static files from "priv/static" directory.## You should set gzip to true if you are running phx.digestdiff --git a/test/support/channel_case.ex b/test/support/channel_case.exdeleted file mode 100644index 2880903192..0000000000--- a/test/support/channel_case.ex+++ /dev/null@@ -1,37 +0,0 @@-defmodule PlausibleWeb.ChannelCase do- @moduledoc """- This module defines the test case to be used by- channel tests.-- Such tests rely on `Phoenix.ChannelTest` and also- import other functionality to make it easier- to build common data structures and query the data layer.-- Finally, if the test case interacts with the database,- it cannot be async. For this reason, every test runs- inside a transaction which is reset at the beginning- of the test unless the test case is marked as async.- """-- use ExUnit.CaseTemplate-- using do- quote do- # Import conveniences for testing with channels- use Phoenix.ChannelTest-- # The default endpoint for testing- @endpoint PlausibleWeb.Endpoint- end- end-- setup tags do- :ok = Ecto.Adapters.SQL.Sandbox.checkout(Plausible.Repo)-- unless tags[:async] do- Ecto.Adapters.SQL.Sandbox.mode(Plausible.Repo, {:shared, self()})- end-- :ok- end-end