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

Storing files of a few megabytes to window.ipfs.files.add hangs Firefox for a minute or more #485

Closed
interfect opened this issue May 28, 2018 · 8 comments · Fixed by #582
Assignees
Labels
area/window-ipfs Issues related to IPFS API exposed on every page kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/blocked/upstream-bug Blocked by upstream bugs
Milestone

Comments

@interfect
Copy link

I'm trying to store MP3 files in IPFS for https://github.com/interfect/ipfstunes by loading them into Buffers and then ipfs.files.add-ing them. Everything works fine using in-page js-ipfs, but with IPFS Companion's window.ipfs, using either the embedded or external node, storing a song-sized file will hang the Firefox UI and make my window manager prompt me to kill it because it is unresponsive.

I don't seem to have this problem with tiny files.

@interfect
Copy link
Author

It takes maybe ~30 seconds of hanging to successfully add a 1.6MB file, in my hands.

@interfect
Copy link
Author

To test, you can go to https://interfect.github.io/ipfstunes with window.ipfs enabled and hit browse under "Add songs" and try and add any reasonably sized MP3 file.

The hang occurs before the prompt to authorize access to ipfs.files.add appears.

@lidel lidel added kind/bug A bug in existing code (including security flaws) status/blocked/upstream-bug Blocked by upstream bugs area/window-ipfs Issues related to IPFS API exposed on every page UX status/ready Ready to be worked labels May 28, 2018
@lidel
Copy link
Member

lidel commented May 28, 2018

Thank you for reporting this. I was able to confirm presence of described delay / high load in Firefox 60.
Chromium 66 does not manifest problematic behavior, it seems to be limited to Firefox, so its an upstream bug in either Firefox or ipfs-postmsg-proxy.

@lidel lidel added the help wanted Seeking public contribution on this issue label May 28, 2018
@lidel lidel added the P2 Medium: Good to have, but can wait until someone steps up label Jun 4, 2018
@lidel lidel added this to the 2018-Q3 milestone Jul 7, 2018
@lidel
Copy link
Member

lidel commented Sep 16, 2018

I created demo page that reliably reproduces the difference between Chrome and Firefox:

Chromium 67

screenshot_45

Firefox (Stable & Nightly)

screenshot_40

screenshot_44


The difference is night and day, it really looks like a bug. Initial guess: related to postMessage handling in webextensions (Firefox bug) or some edge case in serialization done by ipfs-postmsg-proxy (bug in our code). Next step is to create a webextension demo that sends the same amount of data without ipfs-postmsg-proxy.

Sidenote: UI in Firefox Nightly is a little bit more responsive, probably due to the fact Firefox 63+ moved extensions to separate process on Linux.

@lidel
Copy link
Member

lidel commented Sep 16, 2018

Quick test of raw port.postMessage (runtime webextension API) shows no issue:

screenshot_55
screenshot_54

Next: look into serialization in ipfs-postmsg-proxy.

@lidel
Copy link
Member

lidel commented Sep 17, 2018

@alanshaw just a quick check if this is platform-specific:
Do you experience similar slowdown on Firefox+Mac? (test page)

Any thoughts on what could be triggering that problem?
(If it is a bug in Firefox we want to create a MVP demo that can be attached to a new issue at Bugzilla.)

@alanshaw
Copy link
Member

screen shot 2018-09-17 at 12 32 26

@lidel lidel self-assigned this Sep 17, 2018
@lidel lidel removed help wanted Seeking public contribution on this issue status/ready Ready to be worked labels Sep 17, 2018
lidel added a commit that referenced this issue Sep 17, 2018
@lidel
Copy link
Member

lidel commented Sep 19, 2018

@interfect fyi the fix for this was released in beta v2.5.0.11550, will land in stable soon.

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) P2 Medium: Good to have, but can wait until someone steps up status/blocked/upstream-bug Blocked by upstream bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants