From c59f213282517e3ab6fb631a7d8e3f9b91a1c5eb Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 06:35:11 +0200 Subject: add propagation stats --- src/state.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index dfabf8f..b8944ab 100644 --- a/src/state.rs +++ b/src/state.rs @@ -803,7 +803,12 @@ impl AppState { match &result { // One API write = one Automerge change. Ok(_) => { - replica.doc.commit(); + // Stamped with our clock (milliseconds), so receivers can tell + // how long the change took to reach them (`swarm::stats`). + replica.doc.commit_with( + automerge::transaction::CommitOptions::default() + .with_time(unix_millis() as i64), + ); } // Discard partial ops (e.g. old value deleted, new one not written). Err(_) => { -- cgit v1.3.1