fix: Don't allow set_unsigned to panic

While an error in this function is probably bad, detonating a metric tonne of TNT on the call tree is probably worse
This commit is contained in:
timedout committed 2026-09-27 17:32:47 +01:00
1 parent 90793eaaf4
commit 4812837d13
12 files changed
+73 -67

No files matched your search

+4 -1
View File
@@ -3,6 +3,7 @@ use std::{mem::size_of, sync::Arc};
use conduwuit::{
arrayvec::ArrayVec,
matrix::PduCount,
result::LogErr,
utils::{
ReadyExt,
stream::{TryIgnore, WidebandExt},
@@ -99,7 +100,9 @@ impl Data {
.timeline
.get_unsigned_context(&pdu, Some(user_id))
.await;
pdu.set_unsigned(ctx.user_id, ctx.membership, ctx.prev_content, ctx.redacted_because);
pdu.set_unsigned(ctx.user_id, ctx.membership, ctx.prev_content, ctx.redacted_because)
.log_err()
.ok();
Some((shorteventid, pdu))
})
+4 -1
View File
@@ -5,6 +5,7 @@ use conduwuit::{
arrayvec::ArrayVec,
debug_warn,
matrix::event::{Event, Matches},
result::LogErr,
utils::{
ArrayVecExt, IterStream, ReadyExt, set,
stream::{TryIgnore, WidebandExt},
@@ -147,7 +148,9 @@ impl Service {
ctx.membership,
ctx.prev_content,
ctx.redacted_because,
);
)
.log_err()
.ok();
Some(pdu)
})
+4 -1
View File
@@ -1,5 +1,6 @@
use std::{collections::BTreeMap, sync::Arc};
use conduwuit::result::LogErr;
use conduwuit_core::{
Event, Result, err,
matrix::pdu::{PduCount, PduEvent, PduId, RawPduId},
@@ -174,7 +175,9 @@ impl Service {
ctx.membership,
ctx.prev_content,
ctx.redacted_because,
);
)
.log_err()
.ok();
Some((pdu_id.shorteventid, pdu))
});