fix: federation peer-joined updates empty onion addresses
Some checks failed
Build Archipelago ISO (dev) / build-iso (push) Failing after 28m27s
Build Archipelago ISO / build-iso (push) Has been cancelled
Container Orchestration Tests / smoke-tests (push) Has been cancelled
Container Orchestration Tests / unit-tests (push) Has been cancelled

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:
Dorian
2026-04-01 16:25:27 +01:00
parent ce3e64e2d5
commit 6656fed9d6
4 changed files with 344 additions and 26 deletions

View File

@@ -364,7 +364,20 @@ impl RpcHandler {
}
let nodes = federation::load_nodes(&self.config.data_dir).await?;
if nodes.iter().any(|n| n.did == did) {
if let Some(existing) = nodes.iter().find(|n| n.did == did) {
// If already known but missing onion/pubkey, update them
if existing.onion.is_empty() || existing.pubkey.is_empty() {
let mut updated = existing.clone();
if existing.onion.is_empty() && !onion.is_empty() {
updated.onion = onion.to_string();
}
if existing.pubkey.is_empty() && !pubkey.is_empty() {
updated.pubkey = pubkey.to_string();
}
updated.last_seen = Some(chrono::Utc::now().to_rfc3339());
federation::update_node(&self.config.data_dir, &updated).await?;
info!(peer_did = %did, peer_onion = %onion, "Updated existing peer with missing onion/pubkey");
}
return Ok(serde_json::json!({ "accepted": true, "already_known": true }));
}