resolve intake: subscribe order within one diff is not a contract

This commit is contained in:
Meta Vens 2026-11-28 04:21:37 +01:00
commit a4f94ee5bc

View file

@ -225,7 +225,9 @@ fn interests_follow_what_the_held_trees_read() {
rig.offer(&b1);
let (one, two) = (comp_address("one"), comp_address("two"));
// One subscription per address however many surfaces read it.
assert_eq!(rig.interest_calls(), vec![(true, one.clone()), (true, two.clone())]);
let held = rig.interest_calls();
assert_eq!(held.len(), 2);
assert!(held.contains(&(true, one.clone())) && held.contains(&(true, two.clone())));
// Changes and re-applies never resubscribe what is held.
rig.put(&composition("one", "1b"));
@ -235,7 +237,9 @@ fn interests_follow_what_the_held_trees_read() {
// A new version that stops reading `two` lets it go; `one` is untouched.
rig.offer(&surface("a", 2, vec![use_of("u1", "one")]));
assert_eq!(rig.interest_calls(), vec![(true, one.clone()), (true, two.clone()), (false, two.clone())]);
let mut expected = held.clone();
expected.push((false, two.clone()));
assert_eq!(rig.interest_calls(), expected);
// A shared address is released only when its last reader goes.
rig.apply(Change::Delete(surface_address(&a1)));