{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/js-ipfs/issues/1667","repository_url":"https://api.github.com/repos/ipfs/js-ipfs","labels_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/1667/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/1667/comments","events_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/1667/events","html_url":"https://github.com/ipfs/js-ipfs/issues/1667","id":373763781,"node_id":"MDU6SXNzdWUzNzM3NjM3ODE=","number":1667,"title":"CANNOT fetch file( bigger than 256k) in browser.","user":{"login":"LiMoMoMo","id":14027218,"node_id":"MDQ6VXNlcjE0MDI3MjE4","avatar_url":"https://avatars3.githubusercontent.com/u/14027218?v=4","gravatar_id":"","url":"https://api.github.com/users/LiMoMoMo","html_url":"https://github.com/LiMoMoMo","followers_url":"https://api.github.com/users/LiMoMoMo/followers","following_url":"https://api.github.com/users/LiMoMoMo/following{/other_user}","gists_url":"https://api.github.com/users/LiMoMoMo/gists{/gist_id}","starred_url":"https://api.github.com/users/LiMoMoMo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiMoMoMo/subscriptions","organizations_url":"https://api.github.com/users/LiMoMoMo/orgs","repos_url":"https://api.github.com/users/LiMoMoMo/repos","events_url":"https://api.github.com/users/LiMoMoMo/events{/privacy}","received_events_url":"https://api.github.com/users/LiMoMoMo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-25T03:57:56Z","updated_at":"2018-10-25T08:44:44Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThank you for reporting an issue.\r\n\r\nThis issue tracker is for bugs and issues found within the JavaScript implementation of IPFS.\r\nIf you require more general support please file an issue on our discuss forum. https://discuss.ipfs.io/\r\n\r\nPlease fill in as much of the template below as you're able.\r\n\r\nVersion: output of `jsipfs version --all` if using the CLI or `ipfs.version((err, version) => {})` if using the instance.\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows). If using in a Browser, please share the browser version as well.\r\nSubsystem: if known, please specify affected core module name (e.g Bitswap, libp2p, etc).\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you are able.\r\n-->\r\n\r\n- **Version**: 0.33.0-rc.3\r\n- **Platform**: chrome 69.0.3497.100 32bit\r\n- **Subsystem**:\r\n\r\n<!-- Bug, Feature, Question, Enhancement, Etc -->\r\n#### Type: Question\r\n\r\n<!-- \r\nOne of following:\r\n  Critical - System crash, application panic.\r\n  High - The main functionality of the application does not work, API breakage, repo format breakage, etc.\r\n  Medium - A non-essential functionality does not work, performance issues, etc.\r\n  Low - An optional functionality does not work.\r\n  Very Low - Translation or documentation mistake. Something that won't give anyone a bad day.\r\n-->\r\n#### Severity: Medium\r\n\r\n#### Description: \r\nuse the [Exchange files between the browser](https://github.com/ipfs/js-ipfs/tree/master/examples/exchange-files-in-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.\r\n\r\n#### Steps to reproduce the error:\r\n* setup local [signal-server](https://github.com/libp2p/js-libp2p-webrtc-star)\r\n```\r\nnpm install --global libp2p-webrtc-star\r\nstar-signal --port=9090 --host=127.0.0.1\r\n```\r\n* setup the [Exchange files between the browser](https://github.com/ipfs/js-ipfs/tree/master/examples/exchange-files-in-browser)\r\n* change the js-ipfs config in `app.js`\r\n```\r\n    const options = {\r\n      EXPERIMENTAL: {\r\n        pubsub: true\r\n      },\r\n      repo: repoPath,\r\n      config: {\r\n        Addresses: {\r\n          Swarm: ['/dns4/192.168.1.107/tcp/8010/wss/p2p-webrtc-star'],     \r\n          Bootstrap: []\r\n        }\r\n      }\r\n    }\r\n```\r\n* disable the `pubsub`\r\n```\r\nfunction appendFile (name, hash, size, data) {\r\n    ...\r\n  // publishHash(hash)\r\n}\r\n\r\n```\r\n* set Nginx\r\n```\r\nwss:8010   -----> ws:9090\r\nhttps:8000 -----> http:12345\r\n```\r\n* start http-server in the example\r\n* open two page `https://192.168.1.107:8000`\r\nthe pages' Addresses can appear in other's CONNECTED PEERS area each other. \r\nDrag some files to one workspace, then fetch the file by enter the cid in other page.\r\nsome files that smaller than 256K can be fetched, but the file that is big(500k or bigger) cannot be fetched.\r\n\r\n<!--\r\nThis is for you! Please read, and then delete this text before posting it.\r\nThe js-ipfs issues are only for bug reports and directly actionable features.\r\n\r\nRead https://github.com/ipfs/community/blob/master/contributing.md#reporting-issues if your issue doesn't fit either of those categories.\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/ipfs/js-ipfs/issues/comments/432966198","html_url":"https://github.com/ipfs/js-ipfs/issues/1667#issuecomment-432966198","issue_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/1667","id":432966198,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjk2NjE5OA==","user":{"login":"LiMoMoMo","id":14027218,"node_id":"MDQ6VXNlcjE0MDI3MjE4","avatar_url":"https://avatars3.githubusercontent.com/u/14027218?v=4","gravatar_id":"","url":"https://api.github.com/users/LiMoMoMo","html_url":"https://github.com/LiMoMoMo","followers_url":"https://api.github.com/users/LiMoMoMo/followers","following_url":"https://api.github.com/users/LiMoMoMo/following{/other_user}","gists_url":"https://api.github.com/users/LiMoMoMo/gists{/gist_id}","starred_url":"https://api.github.com/users/LiMoMoMo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiMoMoMo/subscriptions","organizations_url":"https://api.github.com/users/LiMoMoMo/orgs","repos_url":"https://api.github.com/users/LiMoMoMo/repos","events_url":"https://api.github.com/users/LiMoMoMo/events{/privacy}","received_events_url":"https://api.github.com/users/LiMoMoMo/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T08:44:43Z","updated_at":"2018-10-25T08:44:43Z","author_association":"NONE","body":"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.\r\n\r\nthe files i added into one page's workspace:\r\n1.  \r\n![3](https://user-images.githubusercontent.com/14027218/47486533-277ad480-d873-11e8-942e-2db939977f4d.jpg)\r\n2.\r\n![4](https://user-images.githubusercontent.com/14027218/47486544-2ba6f200-d873-11e8-9bbf-691c4666ba4b.jpg)\r\n\r\n\r\ni added code to output the wantlist:\r\n```js\r\nsetInterval(refreshState, 100)\r\nfunction refreshState() {\r\n  node.bitswap.stat((err, stats) => console.log('bitswap stat',stats))\r\n}\r\n```\r\nwhen i fetch the smaller file, i can see the **wantlist**'s value in step:\r\n1. empty\r\n2. `QmSm6d2Cjs3a16Ui6Rda4QSbcgm5Wprz21fXunYS6rUuCy` \r\n3. `QmV9tSDx9UiPeWExXEeH6aoDvmihvx6jD5eLb4jbTaKGps`\r\n4. empty\r\n\r\nbut when i fetch the bigger file, the **wantlist**'s value:\r\n1. empty\r\n2. `QmQJbccYkLvyfTnT4SoSKB6WUKqJReXhdW4Dd8jFeyppgo`\r\n3. `QmZrvPiFHEV4GkR1gcAarAfMr3FCoXAhRCws3VaYP3PZFx`\r\n4. `QmPxq9mBhFFbaTAqAS3M3JDXNihMcdpeMxV1Lo2Jd8RAuZ` and \r\n   `QmTASUiQkzpeis7dTeqPZYWwUTs24MzJwXEQtn8eme66Tz`\r\n\r\nwhen the **wantlist** has more than 1 member, the `files.cat()` or `files.get()` cannot work.\r\n\r\n"}}
{"actor":{"display_login":"LiMoMoMo"}}