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

'jsipfs ls' subfolders #1079

Closed
richardschneider opened this issue Nov 16, 2017 · 2 comments · Fixed by #1152
Closed

'jsipfs ls' subfolders #1079

richardschneider opened this issue Nov 16, 2017 · 2 comments · Fixed by #1152
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@richardschneider
Copy link
Contributor

richardschneider commented Nov 16, 2017

jsipfs ls is not processing a path with a sub-folder. Compare the outputs from js and go

>node src\cli\bin.js ls /ipfs/QmRCJXG7HSmprrYwDrK1GctXHgbV7EYpVcJPQPwevoQuqF/test
QmNtpA5TBNqHrKf3cLQ1AiUKXiE4JmUodbG5gXrajg8wdv 277 test/

>ipfs ls /ipfs/QmRCJXG7HSmprrYwDrK1GctXHgbV7EYpVcJPQPwevoQuqF/test
QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM 12  bar
QmX1ebVUtfY11ZCpVmqyE5mDoN62SpLd8eLPpg5GGV1ABt 114 baz/
QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6 12  foo

Detected in #1078

@richardschneider
Copy link
Contributor Author

I think the problem is here

        exporter(ipfsPath, self._ipldResolver, { maxDepth: 1 }),
        pull.filter((node) => node.depth === 1),

Instead of 1 use the number of components in ipfsPath, excluding the optional /ipfs/

@daviddias daviddias added the kind/bug A bug in existing code (including security flaws) label Nov 16, 2017
@daviddias
Copy link
Member

thanks for the report @richardschneider. @pgte mind looking into this?

@ghost ghost added the status/in-progress In progress label Dec 15, 2017
daviddias pushed a commit that referenced this issue Dec 17, 2017
* fix: ipfs ls: allow any depth. Should fix #1079

* chore: CLI: tests: added recursive ls test

* fix bitswap timeouts
@ghost ghost removed the status/in-progress In progress label Dec 17, 2017
richardschneider pushed a commit that referenced this issue Dec 17, 2017
* fix: ipfs ls: allow any depth. Should fix #1079

* chore: CLI: tests: added recursive ls test

* fix bitswap timeouts
MicrowaveDev pushed a commit to galtproject/js-ipfs that referenced this issue May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants