diff --git a/CHANGELOG.md b/CHANGELOG.md index 616c700e..1853413c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Resolve APNS `:too_many_provider_token_updates` by moving token generation into `APNS.Token` ([#227](https://github.com/codedge-llc/pigeon/pull/227)). - Support HTTPoison 2.0. ([#236](https://github.com/codedge-llc/pigeon/pull/236)) +- Fix DispatcherWorker missing a clause for `{:stop, reason}` in the init function ## v2.0.0-rc.1 diff --git a/lib/pigeon/dispatcher_worker.ex b/lib/pigeon/dispatcher_worker.ex index b208f7e1..935d0c87 100644 --- a/lib/pigeon/dispatcher_worker.ex +++ b/lib/pigeon/dispatcher_worker.ex @@ -8,6 +8,7 @@ defmodule Pigeon.DispatcherWorker do GenServer.start_link(__MODULE__, opts) end + @impl GenServer def init(opts) do case opts[:adapter].init(opts) do {:ok, state} -> @@ -16,9 +17,13 @@ defmodule Pigeon.DispatcherWorker do {:error, reason} -> {:error, reason} + + {:stop, reason} -> + {:stop, reason} end end + @impl GenServer def handle_info({:"$push", notification}, %{adapter: adapter, state: state}) do case adapter.handle_push(notification, state) do {:noreply, new_state} ->