mirror of
https://github.com/nostrlabs-io/notepush.git
synced 2025-06-14 11:07:43 +00:00
Handle APNS request errors to ensure all device tokens receive a notification
This commit fixes an issue where having one invalid device token registered can cause other device tokens to not receive push notifications. The issue was fixed by improving error handling around APNS requests Signed-off-by: Daniel D’Aquino <daniel@daquino.me> Closes: https://github.com/damus-io/damus/issues/2408
This commit is contained in:
@ -379,7 +379,11 @@ impl NotificationManager {
|
||||
|
||||
|
||||
let apns_client_mutex_guard = self.apns_client.lock().await;
|
||||
let _response = apns_client_mutex_guard.send(payload).await?;
|
||||
|
||||
match apns_client_mutex_guard.send(payload).await {
|
||||
Ok(_response) => {},
|
||||
Err(e) => log::error!("Failed to send notification to device token '{}': {}", device_token, e),
|
||||
}
|
||||
|
||||
log::info!("Notification sent to device token: {}", device_token);
|
||||
|
||||
|
Reference in New Issue
Block a user