mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-26 19:06:36 +02:00
Add suggested assertations to prevent potentially broken extremities
Some checks failed
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 2s
Rust Checks / Clippy (push) Failing after 32s
Rust Checks / Cargo Test (push) Failing after 31s
Some checks failed
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 2s
Rust Checks / Clippy (push) Failing after 32s
Rust Checks / Cargo Test (push) Failing after 31s
This commit is contained in:
parent
660c260b8d
commit
d02e032cbd
2 changed files with 3 additions and 1 deletions
|
@ -215,6 +215,7 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu(
|
||||||
// if not soft fail it
|
// if not soft fail it
|
||||||
if soft_fail {
|
if soft_fail {
|
||||||
info!("Soft failing event {}", incoming_pdu.event_id);
|
info!("Soft failing event {}", incoming_pdu.event_id);
|
||||||
|
assert!(extremities.is_empty(), "soft_fail extremities empty");
|
||||||
let extremities = extremities.iter().map(Borrow::borrow);
|
let extremities = extremities.iter().map(Borrow::borrow);
|
||||||
|
|
||||||
self.services
|
self.services
|
||||||
|
|
|
@ -976,8 +976,9 @@ impl Service {
|
||||||
state_lock: &'a RoomMutexGuard,
|
state_lock: &'a RoomMutexGuard,
|
||||||
) -> Result<Option<RawPduId>>
|
) -> Result<Option<RawPduId>>
|
||||||
where
|
where
|
||||||
Leaves: Iterator<Item = &'a EventId> + Send + 'a,
|
Leaves: Iterator<Item = &'a EventId> + Send + Clone + 'a,
|
||||||
{
|
{
|
||||||
|
assert!(new_room_leaves.clone().count() > 0, "extremities are empty");
|
||||||
// We append to state before appending the pdu, so we don't have a moment in
|
// We append to state before appending the pdu, so we don't have a moment in
|
||||||
// time with the pdu without it's state. This is okay because append_pdu can't
|
// time with the pdu without it's state. This is okay because append_pdu can't
|
||||||
// fail.
|
// fail.
|
||||||
|
|
Loading…
Add table
Reference in a new issue