Skip to content
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

window.ipfs: ipfs.cat does not return AsyncIterable #852

Closed
SignpostMarv opened this issue Mar 3, 2020 · 4 comments
Closed

window.ipfs: ipfs.cat does not return AsyncIterable #852

SignpostMarv opened this issue Mar 3, 2020 · 4 comments
Labels
area/window-ipfs Issues related to IPFS API exposed on every page kind/bug A bug in existing code (including security flaws)

Comments

@SignpostMarv
Copy link

I'm noticing some slightly odd behaviour when comparing js-ipfs with the ipfs-companion.

js-ipfs cat reliably returns AsyncIterable, but ipfs-companion sometimes returns a Uint8Array and sometimes returns some other function.

generally, with the ipfs-companion enabled the page is stuck at ~110% CPU and frequently crashes or has to have it's task terminated.

Win 10, Chrome 80.0.3987.122, IPFS Companion 2.10.0

@lidel lidel added the area/window-ipfs Issues related to IPFS API exposed on every page label Mar 4, 2020
@lidel lidel changed the title query re: ipfs.cat window.ipfs: ipfs.cat does not return AsyncIterable Mar 4, 2020
@lidel lidel added the kind/bug A bug in existing code (including security flaws) label Mar 4, 2020
@lidel
Copy link
Member

lidel commented Mar 4, 2020

Thank you for reporting this!
I believe this is because IPFS Companion uses older version of js-ipfs and js-ipfs-http-client, thus exposes the old, non-async API.

We are tracking migration to the new js-ipfs(-http-client) in #843, but due to limited bandwidth that won't happen in Q1.

Should we disable window.ipfs until support for async iterables lands in Q2?

@autonome @alanshaw
IPFS Companion exposing non async API does more harm than good right now right now.
Most websites use window.ipfs opportunistically, and will continue working if it is not present.

I want to make a bugfix release and disable window.ipfs experiment until we switch to the new API (keep user preferences and keep it in the UI, but make it greyed out on Preferences screen with a note that we are working on adding support for async iterables and it will come back in the next release).

Y/n?

@SignpostMarv
Copy link
Author

SignpostMarv commented Mar 4, 2020

re: disabling ipfs, it may be of use to end users to expose a means of asserting compatibility with a given js-ipfs semver string?

i.e. to clarify if (window.ipfs && window.ipfs.compatibleWith && window.ipfs.compatibleWith('js-ipfs:~0.41')) { /* use window.ipfs */ } else { /* load js-ipfs */ }

lidel added a commit that referenced this issue Apr 5, 2020
This force-disables injection of window.ipfs and fades out the
experiments on Preferences screen.

We will restore it after move to JS API with Async Await and Async
Iterables is finished.

Context:
#852 (comment)
#843
@baek4837

This comment has been minimized.

@lidel
Copy link
Member

lidel commented Oct 19, 2020

Closing due to #589 (comment)

@lidel lidel closed this as completed Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/window-ipfs Issues related to IPFS API exposed on every page kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants