fix: federation peer-joined updates empty onion addresses
When a node was already known (via link-node) but had an empty onion address, the peer-joined handler returned early without updating the onion. Now it patches missing onion/pubkey fields on existing nodes. Also adds update_node() to federation storage and updates the architecture comparison doc with system resources, StartOS/umbrelOS tabs, Web5 section, and comparison view. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9968b2f915
commit
f49138270a
@@ -96,6 +96,27 @@ pub async fn set_trust_level(
|
||||
Ok(nodes)
|
||||
}
|
||||
|
||||
/// Update a federated node's metadata (onion, pubkey, name, last_seen).
|
||||
pub async fn update_node(data_dir: &Path, updated: &FederatedNode) -> Result<()> {
|
||||
let mut nodes = load_nodes(data_dir).await?;
|
||||
if let Some(node) = nodes.iter_mut().find(|n| n.did == updated.did) {
|
||||
if !updated.onion.is_empty() {
|
||||
node.onion = updated.onion.clone();
|
||||
}
|
||||
if !updated.pubkey.is_empty() {
|
||||
node.pubkey = updated.pubkey.clone();
|
||||
}
|
||||
if updated.name.is_some() {
|
||||
node.name = updated.name.clone();
|
||||
}
|
||||
if updated.last_seen.is_some() {
|
||||
node.last_seen = updated.last_seen.clone();
|
||||
}
|
||||
save_nodes(data_dir, &nodes).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn update_node_state(
|
||||
data_dir: &Path,
|
||||
did: &str,
|
||||
|
||||
Reference in New Issue
Block a user