codedge-llc / pigeon

iOS and Android push notifications for Elixir
https://hex.pm/packages/pigeon
MIT License
639 stars 143 forks source link

Warnings in Pigeon 1.6.2 with Elixir 1.17 #258

Closed nathany-copia closed 2 weeks ago

nathany-copia commented 4 months ago

Environment

Current behavior

warning: using map.field notation (without parentheses) to invoke function Pigeon.Http2.Client.Kadabra.start() is deprecated, you must add parentheses instead: remote.function()
Warning:   (pigeon 1.6.2) lib/pigeon.ex:16: Pigeon.start/2

Expected behavior

No warnings from the Elixir compiler.

Sinc63 commented 3 months ago

I'm only running with Elixir 1.16.3 but I also get these warnings:

==> pigeon
Compiling 28 files (.ex)
     warning: Supervisor.Spec.worker/3 is deprecated. Use the new child specifications outlined in the Supervisor module instead
     │
 167 │     worker = worker(Pigeon.Worker, [Config.new(name)], id: name)
     │              ~
     │
     └─ (pigeon 1.6.2) lib/pigeon/fcm.ex:167:14: Pigeon.FCM.start_connection/1

    warning: Supervisor.Spec.supervisor/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
    │
 38 │     [supervisor(Task.Supervisor, [[name: Pigeon.Tasks]])]
    │      ~
    │
    └─ (pigeon 1.6.2) lib/pigeon.ex:38:6: Pigeon.task_supervisors/0

    warning: Supervisor.Spec.worker/3 is deprecated. Use the new child specifications outlined in the Supervisor module instead
    │
 34 │     [worker(APNS.Token, [%{}], restart: :permanent, shutdown: 5_000)]
    │      ~
    │
    └─ (pigeon 1.6.2) lib/pigeon.ex:34:6: Pigeon.apns_token_agent/0
    └─ (pigeon 1.6.2) lib/pigeon.ex:58:5: Pigeon.worker/1
    └─ (pigeon 1.6.2) lib/pigeon.ex:62:5: Pigeon.worker/1
    └─ (pigeon 1.6.2) lib/pigeon.ex:85:11: Pigeon.workers_for/3
    └─ (pigeon 1.6.2) lib/pigeon.ex:104:12: Pigeon.start_connection/1

     warning: Supervisor.Spec.worker/3 is deprecated. Use the new child specifications outlined in the Supervisor module instead
     │
 128 │     Supervisor.start_child(:pigeon, worker(Pigeon.Worker, [config], id: name))
     │                                     ~
     │
     └─ (pigeon 1.6.2) lib/pigeon/apns.ex:128:37: Pigeon.APNS.start_connection/1

     warning: Supervisor.Spec.worker/3 is deprecated. Use the new child specifications outlined in the Supervisor module instead
     │
 159 │     Supervisor.start_child(:pigeon, worker(Worker, [config], id: name))
     │                                     ~
     │
     └─ (pigeon 1.6.2) lib/pigeon/adm.ex:159:37: Pigeon.ADM.start_connection/1

Generated pigeon app
nathany-copia commented 3 months ago

Yeah, that was reported in #220 as well.

For whatever reason, the Elixir 1.17 warning is showing up in the test suite of a calling application, whereas the Supervisor warnings only show up when compiling pigeon. 🤷🏻

I'd fix those warnings too, but to be honest, I'm not that familiar with supervisors yet.