-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration to the new IPFS JS API with Async Await and Async Iterables #1569
Conversation
Co-authored-by: Marcin Rataj <[email protected]>
Co-authored-by: Marcin Rataj <[email protected]>
Co-authored-by: Marcin Rataj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for investing time on sorting this out @Gozala!
There is a regression on Files screen in functionalities not covered by E2E tests – mind taking a look?
-
File size column and pin status are wonky for directories and empty files.
I suspect API calls used for reading file sizes and pin status changed:master
this PR -
Pinning via context menu does not work (yellow error in UI + one in browser console), most likely for the same reason.
ps. I also found a bug around Download action – it was already in master
so not related to this PR – filled #1576
@@ -21,15 +21,16 @@ | |||
"bundlesize": "bundlesize", | |||
"eject": "react-scripts eject", | |||
"storybook": "start-storybook -p 9009 -s public", | |||
"build-storybook": "build-storybook -s public" | |||
"build-storybook": "build-storybook -s public", | |||
"check": "tsc --noEmit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this PR include GitHub Action that runs this check on every push and PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching all these!
File size was my issue, I have incorrectly entyped Pinning status was fixed by fc6d501. Overlooked that pin status was checked via
Fixed by b1b908c. I have no slightest clue what that code supposed to do however. I believe it attempt to flatten array there so I changed check to only do so on arrays, but would be good if someone more knowledgeable could fill out that TODO: to explain what's up.
Strange. I did tested all the context menu actions, including download (on this branch) and it seems to work and download here. It could be that array flattening code was causing problems for downloads too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Gozala, lgtm now 👍
(Download issue was easy to miss, because it occurs only when more than one item is selected – see details in #1576)
Before we merge this, I'd like @rafaelramalho19 to review this too (to be aware of the scope of changes while rebasing other work on top of this, after the merge).
Overview
We need to upgrade to new IPFS so we can take advantage of a fix to ipfs/js-ipfs#3029 to unblock #1529. However upgrade end up been complicated by introduces async iterable #1431. And all the involved dependencies that had various conflicts that required updating to get through. Below is high level overview of changes this pull packs:
ipfs.add
/ipfs.addAll
API split.ipfsd-ctl
to lastest (so that latest js-ipfs / go-ipfs could be passed in)go-ipfs-dep
togo-ipfs
(because that is what we do elsewhere and that is what ipfsd-ctl seems to suggest. As far as I understood from talking to @lidel former was used for legacy reasons).filesToStreams
got replaced bynormalizeFiles
functionjs-ipfs
/ipfs-http-client
have being improved to no longer require streams..cid
in place of former.hash
due to changes in IPFS API.tsconfig.json
/npm run check
so that files that are annotated get checked.Fixes #1431