a73x

98b4f0e5

Add serde(default) to Event.clock for backward-compatible deserialization

a73x   2026-03-21 13:39

Pre-CRDT events lack the clock field. Adding #[serde(default)] lets them
deserialize as clock=0, which migrate_clocks can then fix up.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

diff --git a/src/event.rs b/src/event.rs
index 135c19b..515f884 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -11,6 +11,7 @@ pub struct Event {
    pub timestamp: String,
    pub author: Author,
    pub action: Action,
    #[serde(default)]
    pub clock: u64,
}