Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialyzer error FCM Notification #211

Open
rlopzc opened this issue Oct 29, 2021 · 3 comments
Open

Dialyzer error FCM Notification #211

rlopzc opened this issue Oct 29, 2021 · 3 comments

Comments

@rlopzc
Copy link

rlopzc commented Oct 29, 2021

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Elixir 1.12.2 (compiled with Erlang/OTP 22)
  • Operating system: Arch Linux

Current behavior

I'm implementing a module to use Pigeon FCM Notification but dialyzer complains. I'm using the example provided in the readme (2.0.0-rc.0)

Expected behavior

Dialyzer not complaining

Code

  @spec send_push_notification(String.t(), %{String.t() => String.t()}) :: :ok
  def send_push_notification(token, payload) do
    Pigeon.FCM.Notification.new({:token, token}, payload)
    |> Okani.FCM.push()

    :ok
  end

Dialyzer error

The function call will not succeed.

Okani.FCM.push(%Pigeon.FCM.Notification{
  :__meta__ => %Pigeon.Metadata{:on_response => nil},
  :android => nil,
  :apns => nil,
  :data => _,
  :error => nil,
  :fcm_options => nil,
  :name => nil,
  :notification => _,
  :response => nil,
  :target => {:condition, _} | {:token, _} | {:topic, _},
  :validate_only => nil,
  :webpush => nil
})

will never return since the 1st arguments differ
from the success typing arguments:

(
  [
    %{
      :__meta__ => %Pigeon.Metadata{:on_response => nil | (_ -> any()) | {_, _} | {_, _, _}}
    },
    ...
  ]
  | %{
      :__meta__ => %Pigeon.Metadata{
        :on_response =>
          nil | (map() -> no_return()) | {atom(), atom()} | {atom(), atom(), [any()]}
      }
    }
)
@madurangae
Copy link

I'm seeing the same error with "2.0.0-rc.0".
Btw, thank you for the amazing library! 🙏

@zaphod534
Copy link
Contributor

I'm seeing the same error with 2.0.0-rc.0 using Pigeon.push

@icecapp
Copy link

icecapp commented Jan 9, 2022

Seeing same issue on "2.0.0-rc.0".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants