matrix-org / sygnal

Sygnal: reference Push Gateway for Matrix
Apache License 2.0
160 stars 144 forks source link

We should treat more kinds of APNs errors as permanent rejections. #279

Closed reivilibre closed 2 years ago

reivilibre commented 2 years ago

See https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/handling_notification_responses_from_apns for a list of error codes.

We currently seem to only treat 410 Unregistered as an error that leads to a rejection making its way back to the homeserver.

However, perhaps we should also reject on DeviceTokenNotForTopic and some more (which we need to decide).

The consideration here is that we should only reject when an error is not Sygnal's fault and is permanent (since the homeserver will delete that pushkey once it's rejected).