From 86e0f29d4cb7b1c935c446fe0e8f495918ed802a Mon Sep 17 00:00:00 2001 From: amiller68 Date: Wed, 2 Oct 2024 12:46:57 -0400 Subject: [PATCH] fix: update link pulling to skip dag pb links --- .github/workflows/build-push-deploy.yaml | 5 +++-- crates/leaky-common/src/mount.rs | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-push-deploy.yaml b/.github/workflows/build-push-deploy.yaml index 9c2493a..577095e 100644 --- a/.github/workflows/build-push-deploy.yaml +++ b/.github/workflows/build-push-deploy.yaml @@ -19,7 +19,7 @@ jobs: id: check run: | git diff --name-only HEAD^ HEAD > changes.txt - if grep -qE '^crates/leaky-server/|^Cargo.lock$' changes.txt; then + if grep -qE '^crates/|^Cargo.lock$' changes.txt; then echo "should_build=true" >> $GITHUB_OUTPUT else echo "should_build=false" >> $GITHUB_OUTPUT @@ -83,4 +83,5 @@ jobs: - name: Clean up SSH key if: always() - run: rm -f ~/.ssh/leaky/admin \ No newline at end of file + run: rm -f ~/.ssh/leaky/admin + diff --git a/crates/leaky-common/src/mount.rs b/crates/leaky-common/src/mount.rs index 7daf39f..22dcad0 100644 --- a/crates/leaky-common/src/mount.rs +++ b/crates/leaky-common/src/mount.rs @@ -192,9 +192,16 @@ impl Mount { let path = clean_path(path); let data_node_cid = self.manifest.lock().data().clone(); - let maybe_new_data_node_cid = - Self::upsert_link_and_object(&data_node_cid, &path, None, None, None, ipfs_rpc, block_cache) - .await?; + let maybe_new_data_node_cid = Self::upsert_link_and_object( + &data_node_cid, + &path, + None, + None, + None, + ipfs_rpc, + block_cache, + ) + .await?; if let Some(new_data_node_cid) = maybe_new_data_node_cid { let new_data_node_cid = if new_data_node_cid == Cid::default() { @@ -314,10 +321,11 @@ impl Mount { block_cache .lock() .insert(cid.to_string(), node.clone().into()); - for (_name, link) in node.iter() { if let Ipld::Link(cid) = link { - if cid.codec() != 0x55 { + // NOTE: this is kinda janky, but dont want to pull dag pb links + // need to figure out how to handle this better + if cid.codec() != 0x55 && cid.codec() != 0x70 { Self::pull_links(cid, block_cache, ipfs_rpc).await?; } }