pushpad / web-push

Web Push library for Ruby (RFC8030) - A fork of zaru/webpush actively maintained by Pushpad with many improvements, bug fixes and updates.
MIT License
145 stars 15 forks source link

Extremely high number of 404 returned by Chrome subscriptions (FCM endpoints) #14

Closed collimarco closed 3 weeks ago

collimarco commented 4 months ago

Starting from Jun 26 we noticed a very high number of Chrome subscriptions (https://fcm.googleapis.com/fcm/send/...) returning 404 errors. All these subscriptions were returning successful status codes in the previous days / months.

This gem then raises InvalidSubscription when a 404 is returned by the endpoint.

This seems like a serious issue in FCM...

I am opening this topic here in case someone is experiencing the same problem or has additional information to share.

collimarco commented 4 months ago

I have also opened an issue in the Chromium bug tracker:

https://issues.chromium.org/issues/349646659

collimarco commented 4 months ago

This is the exact response (from logs):

404 Not Found

A valid push subscription endpoint should be specified in the URL as such: https://fcm.googleapis.com/wp/dHIoDxE7Hdg:APA91bH1Zj0kNa...

Note: the endpoint in the response is not the real FCM endpoint, it seems to be just an example.

welishr commented 4 months ago

Hi this is an intended change where the stale tokens for devices, which have not been connected to FCM in over 270 days, will be considered as expired and invalid. If a request is sent to an invalid token, it will be rejected with a 404 error.

Messages sent to these tokens previously were accepted and then never delivered (because the target devices are inactive), FCM now responds with a 404 instead. We have verified that we have seen no change in our delivery rates over the last week, despite the increase in 404s returned

collimarco commented 4 months ago

@welishr Thanks for the information.

However some of our customers are complaining that they are also seeing a lower number of clicks. So this suggests that many valid subscriptions were also removed...

I see that since this change thee total no. of clicks has dropped from 24k/day to around 14k/day. So it is likely that these contained a lot of valid subscriptions too. [number of notifications successfully sent on the left, number of clicks on the right]

1000000676

This is a serious damage for us and for our customers.

Please inspect this issue and consider restoring all the subscriptions.