aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-08 18:13:54 +0000
committertv <tv@krebsco.de>2026-11-08 19:28:49 +0100
commitd773aac637a2e6dd516d4414c5e58ba3599df1b7 (patch)
tree45edbb2667fc63603df5fbb7cb23556f1e7bc182 /src/remake
parentb1b04ed174ed696a4c3c7988f3640b997a54c7e2 (diff)
access: a change judged by the policy it was written under, locally too
Review 2, N10: the judgement before a change leaves (1140) and a replay's (1141) skipped changes when the document *with* the change had no policy it enforces. A write removing the policy, or setting one the node doesn't know, then left unjudged, while receivers judge it at its dependencies, where the policy was enforced. Both now read the policy at the heads before the change, as receivers do.
Diffstat (limited to 'src/remake')
-rw-r--r--src/remake/delta.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/remake/delta.rs b/src/remake/delta.rs
index dd5df4f..a152861 100644
--- a/src/remake/delta.rs
+++ b/src/remake/delta.rs
@@ -203,7 +203,10 @@ fn judged(
epoch: crate::document::replica::Epoch,
before: &[ChangeHash],
) -> Result<(), String> {
- if !crate::access::policy::of(doc).enforced() {
+ // By the policy it was written under, as receivers judge it.
+ let enforced = crate::document::at::At::new(doc, before)
+ .is_some_and(|at| crate::access::policy::of(&at).enforced());
+ if !enforced {
return Ok(());
}
match doc.get_heads()[..] {