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

Can't disable preload for CLI daemon #1529

Closed
victorb opened this issue Aug 29, 2018 · 4 comments · Fixed by #1909
Closed

Can't disable preload for CLI daemon #1529

victorb opened this issue Aug 29, 2018 · 4 comments · Fixed by #1909
Assignees
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P3 Low: Not priority right now

Comments

@victorb
Copy link
Member

victorb commented Aug 29, 2018

Type:

Bug

Severity:

Low

Description:

Can't disable preloading when running the daemon via the CLI. Even with preload.enabled set to false, the daemon seems to not respect it and when adding data, automatically does the preloading requests.

Steps to reproduce the error:

$ export IPFS_PATH=/tmp/tmp.1MVJtmJWT0
$ node src/cli/bin.js init
$ node src/cli/bin.js config --bool preload.enabled false
$ node src/cli/bin.js config preload.enabled
false
$ jq .preload $IPFS_PATH/config
{
  "enabled": false
}

$ # run daemon with debug to see if preloading is happening
$ DEBUG=jsipfs:preload node src/cli/bin.js daemon

Now in new terminal window

$ export IPFS_PATH=/tmp/tmp.1MVJtmJWT0
$ node src/cli/bin.js add -r node_modules/async # can be anything, just add it

And look back in the first terminal window, there will be bunch of preloading happening, even though preloading is supposed to be off.

@victorb victorb added the kind/bug A bug in existing code (including security flaws) label Aug 29, 2018
@victorb
Copy link
Member Author

victorb commented Aug 29, 2018

Initially thought that #1372 would fix it, but after applying that change, this still happens so seems to be something specific with preloading config.

@alanshaw alanshaw added exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue status/ready Ready to be worked P3 Low: Not priority right now labels Aug 30, 2018
@victorb
Copy link
Member Author

victorb commented Aug 31, 2018

Might have something to do with this

if (options.preload !== false) {
self._preload(cid)
}

Appears in a couple of places

https://github.com/ipfs/js-ipfs/search?q=%22options.preload+%21%3D%3D+false%22&unscoped_q=%22options.preload+%21%3D%3D+false%22

@parkan
Copy link
Contributor

parkan commented Sep 6, 2018

we'd like to be able to turn off preloading for debugging purposes in the IA integration (and because the client is likely not connected to ipfs.io, making preloads useless)

is this broken in browser, as well?

@victorb
Copy link
Member Author

victorb commented Sep 10, 2018

@parkan my guess is yes (but I have not tried it myself) as the checks are in the components/ itself, not the CLI nor HTTP API.

@ghost ghost assigned alanshaw Mar 6, 2019
@ghost ghost added status/in-progress In progress and removed status/ready Ready to be worked labels Mar 6, 2019
@ghost ghost removed the status/in-progress In progress label Mar 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 help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P3 Low: Not priority right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants