Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feat/awesome dag-pb #625

Merged
merged 11 commits into from
Nov 26, 2016
Merged

feat/awesome dag-pb #625

merged 11 commits into from
Nov 26, 2016

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Nov 24, 2016

  • core
  • http
  • cli

facing some issues introduced with new swarms API, will focus on finishing this #600 first

@daviddias daviddias added the status/in-progress In progress label Nov 24, 2016
@daviddias
Copy link
Member Author

Finished #600

Now only a test missing in core:

  1) core --both bitswap connections fetches a remote file 2 peers:
     Error: timeout of 80000ms exceeded. Ensure the done() callback is being called in this test.

Which fails because ipfs.files.add never finishes for a file. Investigating

@daviddias
Copy link
Member Author

Only 6 tests missing (really only 4, because 2 of them are the same thing, just api online and offline)

bootstrap

I didn't even touch any of this, trying to figure out what happened:

1) cli --all bootstrap api running add another bootstrap node:
     Command failed: /Users/ground-control/code/js-ipfs/src/cli/bin.js bootstrap add /ip4/111.111.111.111/tcp/1001/ipfs/QmcyFFKfLDGJKwufn2GeitxvhricsBQyNKTkrD14psikoD
/Users/ground-control/code/js-ipfs/src/cli/commands/bootstrap/add.js:23
          throw err
          ^
2) cli --all bootstrap api running rm a bootstrap node:
     Command failed: /Users/ground-control/code/js-ipfs/src/cli/bin.js bootstrap rm /ip4/111.111.111.111/tcp/1001/ipfs/QmcyFFKfLDGJKwufn2GeitxvhricsBQyNKTkrD14psikoD
/Users/ground-control/code/js-ipfs/src/cli/commands/bootstrap/rm.js:22
          throw err

patch addLink and rmLink

3) cli --all object api offline patch add-link:
     Command failed: /Users/ground-control/code/js-ipfs/src/cli/bin.js object patch add-link QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n foo QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn
/Users/ground-control/code/js-ipfs/node_modules/multihashes/lib/index.js:21
    throw new Error('must be passed a buffer');
4) cli --all object api offline patch rm-link:
     Error: Command failed: /Users/ground-control/code/js-ipfs/src/cli/bin.js object patch rm-link QmdVHE8fUD6FLNLugtNxqDFyhaCgdob372hs6BYEe75VAK foo
src/cli/bin.js object patch rm-link <root> <link>

Options:
  --help  Show help  [boolean]

A link requires a multihash to point to

@dignifiedquire @haadcode @victorbjelkholm can I start getting a CR while I try to figure out these ones? So that we have it on time for tomorrow :)

argv.key,
{ enc: 'base58' },
cb)
], (err, node) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refrain from these cosmetic changes, I will change it back in the next commit any way and it makes it harder to see the relevant changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point! :)

}
)
}
], (err) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a lot more complex and harder to read then before :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is also my attempt of trying to break each step by parts so that I can debug what is happening

return link.name !== linkRef.name
}

return !link.hash.equals(linkRef.hash)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about all the code above, why can we suddenly drop it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was duplicated logic, the addLink/rmLink operations on DAGNode are more complete now.

},
(cb) => {
cb(null, linkedObj.multihash)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use parallel with callbacks anymore

@daviddias
Copy link
Member Author

Now passing tests \o/ with the Caveat that Bootstrap add and rm fail, since it changed in js-ipfs-api and without having it standardized -- ipfs-inactive/interface-js-ipfs-core#97 --, it is hard to follow changes.

@@ -18,7 +18,7 @@
"npm": ">=3.0.0"
},
"scripts": {
"lint": "aegir-lint",
"lint": "eslint -c node_modules/aegir/config/eslintrc.yml src test",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linting is fine, it is just aegir-lint that is being mysterious. This is a known problem by @dignifiedquire, needs to be more investigated.

thanks @victorbjelkholm for the tip! :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, but lets try to not actually merge this code, will see if I can figure this out on the aegir side

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Q. Why did it pass with eslint -c node_modules/aegir/config/eslintrc.yml src test?
  • A. It did not lint examples
  • Q. Why does aegir fail silently?
  • A. An eslint plugin being used in the examples folder: https://github.com/ipfs/js-ipfs/blob/master/examples/bundle-webpack/.eslintrc#L9 was missing, which resulted in an exit from eslint. Running eslint on the command line will print a custom error message for this, which does not happen when using gulp-eslint.
  • Q. Why does linting still fail?
  • A. Because the examples were never properly fixed.

@@ -54,6 +54,7 @@
"buffer-loader": "0.0.1",
"chai": "^3.5.0",
"detect-node": "^2.0.3",
"eslint-plugin-react": "^6.7.1",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, it was because of the added example? 💥

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@daviddias
Copy link
Member Author

Tests suddenly started failing on Travis :( will try to investigate during my flight, locally and on circle is fine :S

@daviddias
Copy link
Member Author

daviddias commented Nov 25, 2016

Found the issue, protocol-buffers was updated with a breaking change

https://github.com/ipfs/js-ipfs-unixfs/blob/master/src/index.js#L54

type became an object: TYPE: { value: 2, options: {} } instead of just the value

Will update once I land and get internet again :)

@mafintosh was that breaking change on the last release intentional?

@daviddias
Copy link
Member Author

CI is green again with new js-ipfs-unixfs released :)

@daviddias daviddias merged commit 1eb664f into master Nov 26, 2016
@daviddias daviddias deleted the feat/awesome-dag-pb branch November 26, 2016 01:34
@daviddias daviddias removed the status/in-progress In progress label Nov 26, 2016
@mafintosh
Copy link

@diasdavid nope wasnt on purpose :( what broke in the latest release?

@mafintosh
Copy link

found and fixed the regression. sry about that.

@daviddias
Copy link
Member Author

thank you @mafintosh <3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants