Compare commits

...
Author SHA1 Message Date
Ginger 4b09176163 chore: News fragment 2026-12-02 22:22:28 -05:00
Ginger aabdb5003c fix: Stop discarding errors when sending a push notification request 2026-12-02 22:15:49 -05:00
2 changed files with 17 additions and 2 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
Errors while sending push notifications will now appear in the server log under more conditions, and will be registered as failures in Prometheus metrics.
+16 -2
View File
@@ -970,6 +970,8 @@ impl Service {
} }
} }
let mut first_push_error = None;
for pdu in pdus { for pdu in pdus {
// Redacted events are not notification targets (we don't send push // Redacted events are not notification targets (we don't send push
// for them) // for them)
@@ -995,16 +997,28 @@ impl Service {
.try_into() .try_into()
.expect("notification count can't go that high"); .expect("notification count can't go that high");
let _response = self let response = self
.services .services
.pusher .pusher
.send_push_notice(&user_id, unread, &pusher, rules_for_user, &pdu) .send_push_notice(&user_id, unread, &pusher, rules_for_user, &pdu)
.await .await
.map_err(|e| (Destination::Push(user_id.clone(), pushkey.clone()), e)); .map_err(|e| (Destination::Push(user_id.clone(), pushkey.clone()), Box::new(e)));
if let Err(err) = response {
error!(event = %pdu.event_id, pusher = %pusher.app_display_name, "Failed to deliver push notification: {err:?}");
if first_push_error.is_none() {
first_push_error = Some(err);
}
}
} }
if let Some(err) = first_push_error {
Err(err)
} else {
Ok(Destination::Push(user_id, pushkey)) Ok(Destination::Push(user_id, pushkey))
} }
}
async fn send_events_dest_federation( async fn send_events_dest_federation(
&self, &self,