diff options
| author | tv <tv@krebsco.de> | 2026-10-20 00:51:39 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-20 00:51:39 +0200 |
| commit | a40d8da20f7b40bcdf2f7e335f51aa6b39465318 (patch) | |
| tree | 14e040a3764000746eec0ceea8d8a2faebd6e52e /src/sync.rs | |
| parent | 502f95f170a6205b6b3fa41324a9c80ba34fb5b9 (diff) | |
add epoch switch
Diffstat (limited to 'src/sync.rs')
| -rw-r--r-- | src/sync.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sync.rs b/src/sync.rs index afa27cf..2689375 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -458,6 +458,12 @@ pub(crate) async fn run_change_publisher(state: AppState) { return (heads, Vec::new(), Vec::new()); } + // After an epoch switch the previous heads belong to the old document: + // report the root as changed, which every stream is related to. + if !before.iter().all(|h| doc.get_change_by_hash(h).is_some()) { + return (heads, vec![Vec::new()], Vec::new()); + } + let mut paths = Vec::new(); let mut conflicts = Vec::new(); for patch in doc.diff(&before, &heads) { |
