Skip to content

Commit

Permalink
fix: update link pulling to skip dag pb links
Browse files Browse the repository at this point in the history
  • Loading branch information
amiller68 committed Oct 2, 2024
1 parent 184cf6b commit 86e0f29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-push-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -83,4 +83,5 @@ jobs:
- name: Clean up SSH key
if: always()
run: rm -f ~/.ssh/leaky/admin
run: rm -f ~/.ssh/leaky/admin

18 changes: 13 additions & 5 deletions crates/leaky-common/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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?;
}
}
Expand Down

0 comments on commit 86e0f29

Please sign in to comment.