ipfs-postmsg-proxy icon indicating copy to clipboard operation
ipfs-postmsg-proxy copied to clipboard

Improve error handling related to big uploads

Open lidel opened this issue 7 years ago • 0 comments
trafficstars

Extracted from https://github.com/ipfs-shipyard/ipfs-webui/pull/669#issuecomment-393506628:

Uploading large files kills chrome. [..] should we port that logic to window.ipfs? or at lease wrap window.ipfs with it, as any app that tries to do it is going to hit this problem. It's not ideal but I think it's better that we throw an error that the developer can catch rather than letting the tab fail.

Background

There are two known issues related to upload of big files. I described both in: https://github.com/ipfs-shipyard/ipfs-companion/issues/464#issuecomment-382446114, but the gist is:

  • Chrome extension process crashing on files >128MiB (https://github.com/ipfs-shipyard/ipfs-companion/issues/464)
  • Firefox works fine with 1GB file, but things bigger than 2GB hit language/lib limitations and fail silently with: RangeError: Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes

Workaround

In both cases we could add <vendor>+<size> guards that preemptively throw Error, removing the need for developer using window.ipfs to do repetitive error-handling in userland. It should be enough until the issue is solved upstream.

lidel avatar May 31 '18 16:05 lidel