From 84ab15f2e34cf5bb2cdf82ca177fe0d800dd7ccb Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Mon, 3 Aug 2026 07:54:47 -0400 Subject: [PATCH] Clarify roster update result --- src/app/sync.rs | 2 +- src/storage.rs | 2 +- src/storage/rosters.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/sync.rs b/src/app/sync.rs index 9ad0adf..d30d44d 100644 --- a/src/app/sync.rs +++ b/src/app/sync.rs @@ -193,7 +193,7 @@ impl AppaService { anyhow::bail!("peer returned a conflicting folder roster epoch"); } self.state_store.save_peer(folder.id, peer)?; - let accepted_new_roster = self.state_store.accept_roster(roster)?; + let accepted_new_roster = self.state_store.save_roster_if_newer(roster)?; self.save_roster_peers(folder.id, roster, peer_endpoints)?; if accepted_new_roster && capability != folder.capability { self.state_store.update_capability(folder.id, capability)?; diff --git a/src/storage.rs b/src/storage.rs index 288c8fd..9f4ea37 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -175,7 +175,7 @@ impl StateStore { if invite.roster.folder_id != invite.folder_id { anyhow::bail!("invitation roster belongs to a different folder"); } - self.accept_roster(&invite.roster)?; + self.save_roster_if_newer(&invite.roster)?; if let Some(existing_folder) = self.find_folder(path)? && existing_folder.id != invite.folder_id { diff --git a/src/storage/rosters.rs b/src/storage/rosters.rs index 8b5d83f..aab4111 100644 --- a/src/storage/rosters.rs +++ b/src/storage/rosters.rs @@ -51,7 +51,7 @@ impl StateStore { .transpose() } - pub fn accept_roster(&self, roster: &FolderRoster) -> anyhow::Result { + pub fn save_roster_if_newer(&self, roster: &FolderRoster) -> anyhow::Result { roster.validate()?; let Some(current) = self.load_roster(roster.folder_id)? else { self.save_roster(roster)?; -- knotmirror 0.0.1