From ece6c1e615f260b31f06a4668496f92a2e26052b Mon Sep 17 00:00:00 2001 From: Darius Date: Mon, 23 Dec 2024 01:21:39 -0500 Subject: [PATCH] chore: comment out message extraction temporarily for community --- .../src/store/message/community_task.rs | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/extensions/warp-ipfs/src/store/message/community_task.rs b/extensions/warp-ipfs/src/store/message/community_task.rs index e030e59b4..ad3a0a6a2 100644 --- a/extensions/warp-ipfs/src/store/message/community_task.rs +++ b/extensions/warp-ipfs/src/store/message/community_task.rs @@ -1226,30 +1226,32 @@ impl CommunityTask { let event = match self.keystore.get_latest(keypair, &sender) { Ok(key) => data.message_from_key(&key)?, Err(Error::PublicKeyDoesntExist) => { - match data.message(keypair) { - Ok(message) => message, - _ => { - // If we are not able to get the latest key from the store, this is because we are still awaiting on the response from the key exchange - // So what we should so instead is set aside the payload until we receive the key exchange then attempt to process it again - - // Note: We can set aside the data without the payload being owned directly due to the data already been verified - // so we can own the data directly without worrying about the lifetime - // however, we may want to eventually validate the data to ensure it havent been tampered in some way - // while waiting for the response. - let bytes = data.to_bytes()?; - self.pending_key_exchange - .entry(sender) - .or_default() - .push((bytes, false)); - - // Maybe send a request? Although we could, we should check to determine if one was previously sent or queued first, - // but for now we can leave this commented until the queue is removed and refactored. - // _ = self.request_key(id, &data.sender()).await; - - // Note: We will mark this as `Ok` since this is pending request to be resolved - return Ok(()); - } - } + // match data.message(keypair) { + // Ok(message) => { + // message + // } + // _ => { + // If we are not able to get the latest key from the store, this is because we are still awaiting on the response from the key exchange + // So what we should so instead is set aside the payload until we receive the key exchange then attempt to process it again + + // Note: We can set aside the data without the payload being owned directly due to the data already been verified + // so we can own the data directly without worrying about the lifetime + // however, we may want to eventually validate the data to ensure it havent been tampered in some way + // while waiting for the response. + let bytes = data.to_bytes()?; + self.pending_key_exchange + .entry(sender) + .or_default() + .push((bytes, false)); + + // Maybe send a request? Although we could, we should check to determine if one was previously sent or queued first, + // but for now we can leave this commented until the queue is removed and refactored. + // _ = self.request_key(id, &data.sender()).await; + + // Note: We will mark this as `Ok` since this is pending request to be resolved + return Ok(()); + // } + // } } Err(e) => { tracing::warn!(id = %id, sender = %data.sender(), error = %e, "Failed to obtain key");