Skip to content

Commit

Permalink
Merge pull request #596 from ipfs-shipyard/fix/150mb-upload-crash
Browse files Browse the repository at this point in the history
Fix Chromium crash on 150MB upload
  • Loading branch information
lidel authored Oct 1, 2018
2 parents 952e11f + 19cf1dd commit 329199b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
9 changes: 0 additions & 9 deletions add-on/src/popup/quick-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ async function processFiles (state, emitter, files) {
const { ipfsCompanion } = await browser.runtime.getBackgroundPage()
const uploadTab = await browser.tabs.getCurrent()
let { streams, totalSize } = files2streams(files)
if (!browser.runtime.id.includes('@')) {
// we are in non-Firefox runtime (we know for a fact that Chrome puts no @ in id)
if (state.ipfsNodeType === 'external' && totalSize >= 134217728) {
// avoid crashing Chrome until the source of issue is fixed in js-ipfs-api
// - https://github.com/ipfs-shipyard/ipfs-companion/issues/464
// - https://github.com/ipfs/js-ipfs-api/issues/654
throw new Error('Unable to process payload bigger than 128MiB in Chrome. See: js-ipfs-api/issues/654')
}
}
progressHandler(0, totalSize, state, emitter)
emitter.emit('render')
const wrapFlag = (state.wrapWithDirectory || streams.length > 1)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"private": true,
"preferGlobal": false,
"resolutions": {
"stream-http": "https://github.com/jhiesey/stream-http/tarball/2a8467dd84da9ab93cb43ca6cf78a75fef07f282/stream-http.tar.gz",
"uglify-es": "npm:terser"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10687,9 +10687,9 @@ stream-each@^1.1.0:
end-of-stream "^1.1.0"
stream-shift "^1.0.0"

stream-http@^2.7.2, stream-http@^2.8.3:
stream-http@^2.7.2, stream-http@^2.8.3, "stream-http@https://github.com/jhiesey/stream-http/tarball/2a8467dd84da9ab93cb43ca6cf78a75fef07f282/stream-http.tar.gz":
version "2.8.3"
resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc"
resolved "https://github.com/jhiesey/stream-http/tarball/2a8467dd84da9ab93cb43ca6cf78a75fef07f282/stream-http.tar.gz#6975289c60e4f2061fb6f544472357ffd13c9170"
dependencies:
builtin-status-codes "^3.0.0"
inherits "^2.0.1"
Expand Down

0 comments on commit 329199b

Please sign in to comment.