Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

CANNOT fetch file( bigger than 256k) in browser. #1667

Closed
LiMoMoMo opened this issue Oct 25, 2018 · 5 comments
Closed

CANNOT fetch file( bigger than 256k) in browser. #1667

LiMoMoMo opened this issue Oct 25, 2018 · 5 comments
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up

Comments

@LiMoMoMo
Copy link

  • Version: 0.33.0-rc.3
  • Platform: chrome 69.0.3497.100 32bit
  • Subsystem:

Type: Question

Severity: Medium

Description:

use the Exchange files between the browser, upload some files to one page's worksapce, i can fetch the fie which is smaller than 256K by enter the CID in other page, BUT can not fetch the file bigger than 256K.

Steps to reproduce the error:

npm install --global libp2p-webrtc-star
star-signal --port=9090 --host=127.0.0.1
    const options = {
      EXPERIMENTAL: {
        pubsub: true
      },
      repo: repoPath,
      config: {
        Addresses: {
          Swarm: ['/dns4/192.168.1.107/tcp/8010/wss/p2p-webrtc-star'],     
          Bootstrap: []
        }
      }
    }
  • disable the pubsub
function appendFile (name, hash, size, data) {
    ...
  // publishHash(hash)
}

  • set Nginx
wss:8010   -----> ws:9090
https:8000 -----> http:12345
  • start http-server in the example
  • open two page https://192.168.1.107:8000
    the pages' Addresses can appear in other's CONNECTED PEERS area each other.
    Drag some files to one workspace, then fetch the file by enter the cid in other page.
    some files that smaller than 256K can be fetched, but the file that is big(500k or bigger) cannot be fetched.
@LiMoMoMo LiMoMoMo changed the title CANNOT fetch file(is bigger than 256k) in browser. CANNOT fetch file( bigger than 256k) in browser. Oct 25, 2018
@LiMoMoMo
Copy link
Author

it looks like the api node.files.cat(hash) or node.files.get(hash) cannot work well when the node(the hash pointed) contains more than one child.

the files i added into one page's workspace:
1.
3
2.
4

i added code to output the wantlist:

setInterval(refreshState, 100)
function refreshState() {
  node.bitswap.stat((err, stats) => console.log('bitswap stat',stats))
}

when i fetch the smaller file, i can see the wantlist's value in step:

  1. empty
  2. QmSm6d2Cjs3a16Ui6Rda4QSbcgm5Wprz21fXunYS6rUuCy
  3. QmV9tSDx9UiPeWExXEeH6aoDvmihvx6jD5eLb4jbTaKGps
  4. empty

but when i fetch the bigger file, the wantlist's value:

  1. empty
  2. QmQJbccYkLvyfTnT4SoSKB6WUKqJReXhdW4Dd8jFeyppgo
  3. QmZrvPiFHEV4GkR1gcAarAfMr3FCoXAhRCws3VaYP3PZFx
  4. QmPxq9mBhFFbaTAqAS3M3JDXNihMcdpeMxV1Lo2Jd8RAuZ and
    QmTASUiQkzpeis7dTeqPZYWwUTs24MzJwXEQtn8eme66Tz

when the wantlist has more than 1 member, the files.cat() or files.get() cannot work.

@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important status/ready Ready to be worked P2 Medium: Good to have, but can wait until someone steps up labels Oct 31, 2018
@alanshaw
Copy link
Member

@vasco-santos would you mind looking into this bug when you have a moment?

@LiMoMoMo
Copy link
Author

LiMoMoMo commented Nov 1, 2018

it seems that i made a mistake, i'm sorry.
This problem occurs between tabs that in different browsers, opera and chrome.

@AquiGorka
Copy link
Member

This is still a thing, I submitted an issue back here: #1307

@alanshaw
Copy link
Member

alanshaw commented Feb 6, 2019

closing this in favour of #1307

@alanshaw alanshaw closed this as completed Feb 6, 2019
@ghost ghost removed the status/ready Ready to be worked label Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

No branches or pull requests

3 participants