diff options
Diffstat (limited to 'src/document')
| -rw-r--r-- | src/document/signatures.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/document/signatures.rs b/src/document/signatures.rs index 4f34ecb..79c8569 100644 --- a/src/document/signatures.rs +++ b/src/document/signatures.rs @@ -603,11 +603,15 @@ impl Signatures { /// Whether `change`, not in `doc`, forks its actor's changes: `doc` holds a change /// a signature verified of that actor at a seq as late, so its real change at /// `change`'s seq too. Anyone can make a change under any actor; only its node can - /// sign one. + /// sign one. Or the actor is the one `doc` writes as, and it made a change at a seq + /// as late: another node writing as it too made this one. pub(crate) fn forks(&self, doc: &Document, change: &super::Change) -> bool { self.latest.get(change.actor_id()).is_some_and(|latest| { latest.seq >= change.seq() && super::changes::holds(doc, &latest.hash) - }) + }) || (change.actor_id() == doc.get_actor() + && doc + .get_last_local_change() + .is_some_and(|own| own.seq() >= change.seq())) } /// Whether a signature vouches for `actor`'s change `seq`. |
