mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-28 19:37:32 +00:00
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:
12 files changed
+73
-67
No files matched your search
@@ -63,7 +63,7 @@ pub(crate) async fn get_room_event_route(
|
||||
.timeline
|
||||
.get_unsigned_context(&event, Some(sender_user))
|
||||
.await;
|
||||
event.set_unsigned(ctx.user_id, ctx.membership, ctx.prev_content, ctx.redacted_because);
|
||||
event.set_unsigned(ctx.user_id, ctx.membership, ctx.prev_content, ctx.redacted_because)?;
|
||||
|
||||
Ok(get_room_event::v3::Response::new(event.into_format()))
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Event, Result, at, debug_warn,
|
||||
result::LogErr,
|
||||
utils::{BoolExt, stream::TryTools},
|
||||
};
|
||||
use futures::{FutureExt, TryStreamExt, future::try_join4};
|
||||
@@ -58,12 +59,10 @@ pub(crate) async fn room_initial_sync_route(
|
||||
.timeline
|
||||
.get_unsigned_context(&pdu.1, Some(sender_user))
|
||||
.await;
|
||||
pdu.1.set_unsigned(
|
||||
ctx.user_id,
|
||||
ctx.membership,
|
||||
ctx.prev_content,
|
||||
ctx.redacted_because,
|
||||
);
|
||||
pdu.1
|
||||
.set_unsigned(ctx.user_id, ctx.membership, ctx.prev_content, ctx.redacted_because)
|
||||
.log_err()
|
||||
.ok();
|
||||
if let Err(e) = services
|
||||
.rooms
|
||||
.pdu_metadata
|
||||
|
||||
Reference in new issue
Block a user