codedge-llc / pigeon

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

Got timeout error, but the notification is successfully sent #216

Closed zaphod534 closed 1 year ago

zaphod534 commented 2 years ago

Environment

Current behavior

After a while, the library stop processing the notifications response and give the :timeout error cause, even though the notification is successfully sent to the FCM / APNS servers and the response is successfully received.

After digging into the problem, I noticed that the issue happens when the HTTP2 stream_id numbering restart from 1, while the library keeps incrementing it, so every reference for any subsequent notification on that worker is lost.

Steps to reproduce:

  1. Send notifications
  2. Wait for a while (a couple of minutes or maybe more)
  3. Try to send notifications again
  4. Got timeout error.

Expected behavior

The library should process the notification response.

icecapp commented 2 years ago

I'm getting this too on 2.0.0-rc0

icecapp commented 2 years ago

Just tested this on a stock project and it is reproducible

jakecurreri commented 2 years ago

Issue exists in a production app for 2.0.0-rc.0, sending to ~1k devices.

I thought it was a batching issue on my part then noticed the issue ticket.

icecapp commented 2 years ago

After further testing, some of these timeouts are actually failing and FCM messages are not being delivered

hpopp commented 2 years ago

Merged #217. I wonder how I missed that in the 2.0 refactor. Let me address some of the issues in Kadabra and see if it needs a new version before cutting a new release candidate here.

Thanks for everyone's help on this. I've been out of the loop the past month or so.

jakecurreri commented 1 year ago

@hpopp were you able to cut a new 2.0 release candidate with the fix? Thanks.

hpopp commented 1 year ago

Published 2.0.0-rc.1. I also updated goth to 1.3 now that it's out of RC https://github.com/codedge-llc/pigeon/pull/224.

So I need to address #221 and do some minor cleanup on my end before I consider us good for 2.0 official release. It seems like with how busy I've been over the last year, time keeps slipping by. In a perfect world I could work on nothing but my open source packages, but of course that'll never happen 😅