diff --git a/extensions/warp-ipfs/src/shuttle/server.rs b/extensions/warp-ipfs/src/shuttle/server.rs index 282f12edf..2f6767a74 100644 --- a/extensions/warp-ipfs/src/shuttle/server.rs +++ b/extensions/warp-ipfs/src/shuttle/server.rs @@ -418,7 +418,7 @@ impl ShuttleTask { } }; - tracing::info!(%document.did, "Receive register request"); + tracing::info!(%document.did, "receive register request"); if identity_storage.contains(&document.did).await { tracing::warn!(%document.did, "Identity is already registered"); let payload = payload_message_construct( @@ -438,6 +438,7 @@ impl ShuttleTask { return; } + tracing::info!(%document.did, %sender_peer_id, "verifying identity document"); if document.verify().is_err() { tracing::warn!(%document.did, "Identity cannot be verified"); let payload = payload_message_construct( @@ -457,6 +458,8 @@ impl ShuttleTask { return; } + tracing::info!(%document.did, %sender_peer_id, "identity verified. registering identity"); + if let Err(e) = identity_storage.register(&document, root_cid).await { tracing::warn!(%document.did, error = %e, "Unable to register identity"); let res_error = match e { @@ -481,6 +484,8 @@ impl ShuttleTask { return; } + tracing::info!(%document.did, %sender_peer_id, "identity regostered"); + if let Err(e) = subscriptions.subscribe(document.did.inbox()).await { tracing::warn!(%document.did, "Unable to subscribe to given topic: {e}. ignoring..."); // Although we arent able to subscribe, we can still process the request while leaving this as a warning @@ -904,7 +909,11 @@ impl ShuttleTask { } }; + tracing::info!(%sender_peer_id, "pushing task into queue"); self.requests.push(fut.boxed()); + // since we have "pending" future, we can remove one from the total value since it will always be pending + let total_requests = self.requests.len() - 1; + tracing::debug!(total_requests); } fn process_message_events( diff --git a/extensions/warp-ipfs/src/shuttle/store/identity.rs b/extensions/warp-ipfs/src/shuttle/store/identity.rs index 649cbbf4d..ea74166a9 100644 --- a/extensions/warp-ipfs/src/shuttle/store/identity.rs +++ b/extensions/warp-ipfs/src/shuttle/store/identity.rs @@ -146,16 +146,21 @@ impl IdentityStorageInner { return Err(Error::IdentityExist); } + tracing::info!(%did_str, "inserting document"); list.insert(did_str, root_cid); + tracing::info!(did = %document.did, "document inserted. restructuring dag"); let cid = self.ipfs.put_dag(list).await?; - self.ipfs.insert_pin(cid).recursive().await?; - + // tracing::info!(did = %document.did, "pinning document"); + // self.ipfs.insert_pin(cid).recursive().await?; + // + // tracing::info!(did = %document.did, "pinning successful"); let old_cid = self.users.replace(cid); if let Some(old_cid) = old_cid { if old_cid != cid && self.ipfs.is_pinned(&old_cid).await.unwrap_or_default() { + tracing::info!(did = %document.did, "unpinning previous document"); _ = self.ipfs.remove_pin(old_cid).await; } } @@ -215,7 +220,7 @@ impl IdentityStorageInner { let cid = self.ipfs.put_dag(list).await?; - self.ipfs.insert_pin(cid).recursive().await?; + // self.ipfs.insert_pin(cid).recursive().await?; let old_cid = self.users.replace(cid); if let Some(old_cid) = old_cid { @@ -427,7 +432,7 @@ impl IdentityStorageInner { list.insert(key_str, cid); - let cid = self.ipfs.put_dag(list).pin(true).await?; + let cid = self.ipfs.put_dag(list).await?; let old_cid = self.mailbox.replace(cid); @@ -490,7 +495,7 @@ impl IdentityStorageInner { list.insert(key_str, cid); - let cid = self.ipfs.put_dag(list).pin(true).await?; + let cid = self.ipfs.put_dag(list).await?; let old_cid = self.mailbox.replace(cid);