fix: Stop discarding errors when sending a push notification request

This commit is contained in:
Ginger committed 2026-12-02 22:15:49 -05:00
1 parent d5cf029135
commit aabdb5003c
1 file changed
+17 -3
+17 -3
View File
@@ -970,6 +970,8 @@ impl Service {
}
}
let mut first_push_error = None;
for pdu in pdus {
// Redacted events are not notification targets (we don't send push
// for them)
@@ -995,15 +997,27 @@ impl Service {
.try_into()
.expect("notification count can't go that high");
let _response = self
let response = self
.services
.pusher
.send_push_notice(&user_id, unread, &pusher, rules_for_user, &pdu)
.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);
}
}
}
Ok(Destination::Push(user_id, pushkey))
if let Some(err) = first_push_error {
Err(err)
} else {
Ok(Destination::Push(user_id, pushkey))
}
}
async fn send_events_dest_federation(