Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Improve error handling related to big uploads #33

@lidel

Description

@lidel

Extracted from ipfs/ipfs-webui#669 (comment):

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: ipfs/ipfs-companion#464 (comment), but the gist is:

  • Chrome extension process crashing on files >128MiB (crash when dropping a big file ipfs/ipfs-companion#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions