Skip to content

Commit f234949

Browse files
author
Charles Bournhonesque
committed
simplify tests
Change-Id: I7c7dc584d45abc0b1e0a0690a4472c4075dce2c8
1 parent 7df2122 commit f234949

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

tests/diff.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -593,21 +593,16 @@ fn write_point_history(
593593
// cursor `Some(0)`.
594594
let base_cursor = first_patch_index.checked_sub(1);
595595
let cursor = Some(first_patch_index + patches.len() as PatchIndex - 1);
596-
let live_is_base = entity
597-
.get::<DiffReceiver<Points>>()
598-
.is_some_and(|receiver| receiver.last_applied() == base_cursor);
596+
// The base must come from a confirmed value in the history: consumers
597+
// like prediction/interpolation may locally mutate the live component,
598+
// so it can never be used as a patch base.
599599
let mut value = entity
600600
.get::<PointHistory>()
601601
.and_then(|history| {
602602
history.0.iter().rev().find_map(|(_, cursor, value)| {
603603
(*cursor == base_cursor).then(|| value.clone())
604604
})
605605
})
606-
.or_else(|| {
607-
live_is_base
608-
.then(|| entity.get::<Points>().cloned())
609-
.flatten()
610-
})
611606
.ok_or_else(|| {
612607
format!(
613608
"received diff patches for `{}` without a confirmed base",

0 commit comments

Comments
 (0)