diff options
| author | tv <tv@krebsco.de> | 2026-11-29 02:48:25 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 02:48:25 +0000 |
| commit | 8a29efed857991417d12b8e21884dbbcb53ff4a0 (patch) | |
| tree | f57da52ac22090146c3f3baac23fb0b5dd2938dc /src/swarm | |
| parent | b259ee75fbbbf8e265a0bf2a0b79c4f6a75f395a (diff) | |
document: the writers a node wrote under are the document's, not a remake's
The actors a node writes or wrote with in its current document
(document::own::OwnWriters, AppState::own_writers) were kept by the
remake state, which signing, the document file, sync and a dropped
change read them from. They are the engine's: a document of a kind
without writers of this sort has none, and needs no remake state for
them.
Diffstat (limited to 'src/swarm')
| -rw-r--r-- | src/swarm/document_file.rs | 2 | ||||
| -rw-r--r-- | src/swarm/sync.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/swarm/document_file.rs b/src/swarm/document_file.rs index c833656..6c71e42 100644 --- a/src/swarm/document_file.rs +++ b/src/swarm/document_file.rs @@ -66,7 +66,7 @@ pub(crate) async fn flush(state: &AppState) { if !state.is_ready().await { return; } - let own = state.remake.own_actors(); + let own = state.own_writers.all(); let (epoch, heads, signatures) = { let replica = state.doc.read().await; ( diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index ad8c0a0..45698fa 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -621,7 +621,7 @@ pub(crate) async fn handle_sync( let peer = peer.to_owned(); let clock = Arc::clone(&state.clock); let ahead_ms = state.clock_ahead_ms.load(Ordering::Relaxed); - let remake = Arc::clone(&state.remake); + let own_writers = Arc::clone(&state.own_writers); // Some((level with a ready peer, heads changed, carried changes, the new changes' // authors with theirs, and whether any has none, how long to wait before answering @@ -707,7 +707,7 @@ pub(crate) async fn handle_sync( tracing::warn!(peer = %peer, forged = outcome.forged, "A peer brought changes forged under another node's actor: refused"); } if let Some(actor) = outcome.fresh_actor { - remake.add_own_actor(actor); + own_writers.add(actor); } sync.lacks(screening.lock_or_recover().waiting.lacking(doc)); } @@ -1016,7 +1016,7 @@ async fn download_and_apply_delta( let clock = Arc::clone(&state.clock); let ahead_ms = state.clock_ahead_ms.load(Ordering::Relaxed); let screening = Arc::clone(&state.screening); - let remake = Arc::clone(&state.remake); + let own_writers = Arc::clone(&state.own_writers); tokio::task::spawn_blocking(move || -> Result<bool> { let mut replica = doc.blocking_write(); if replica.epoch != epoch { @@ -1040,7 +1040,7 @@ async fn download_and_apply_delta( &mut crate::document::PatchLog::inactive(), )?; if let Some(actor) = outcome.fresh_actor { - remake.add_own_actor(actor); + own_writers.add(actor); } } replica.refresh_heads(); |
