-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Merge pull request #2657 from ipfs/feature/add-defaults-to-add" #3239
Conversation
710c1b0
to
e04abc2
Compare
e04abc2
to
5c7a393
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the one change I noted. I think this is okay. In order for me to really say it is okay I would have needed to do the revert itself. There is some stuff with the progress bar setting I don't fully understand.
cmds.StringOption(chunkerOptionName, "s", "Chunking algorithm to use."), | ||
cmds.BoolOption(pinOptionName, "Pin this object when adding.").Default(true), | ||
cmds.BoolOption(pinOptionName, "Pin this object when adding. Default: true."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should still be ".Default(true)."
|
||
if !pin_found { // default | ||
dopin = true | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if !pin_found {...}
should not be necessary. See earlier comment.
} | ||
|
||
req.SetOption(progressOptionName, progress) | ||
|
||
sizeFile, ok := req.Files().(files.SizeFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I don't understand what is going on here. Why are we setting progressOptionName if it is not found. See my note in the PostRun function.
@@ -242,7 +247,7 @@ You can now refer to the added file in a gateway, like so: | |||
return | |||
} | |||
|
|||
progress, _, err := req.Option(progressOptionName).Bool() | |||
progress, prgFound, err := req.Option(progressOptionName).Bool() | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Okay so how is it that prgFound can be false, it we explicitly set it the PreRun. I am very unsure of the correct behavior here. What was the original intention. @whyrusleeping @Kubuxu any ideas?
Everyone. I will be willing to just take over this pull request and redo it if it would be easier, but I don't want to step on anyone's toes. |
My toes are very small. It is hard to step on them. :) Take it away! Thank you, @kevina. |
Regarding your questions: I don't know, I am not invested, and I won't pretend my edits were high quality. They were the best I managed at the time, but realistically, if you don't understand something I did, that's my fault, not yours. Feel free to close this PR unmerged if that is the easiest way forward. |
@RichardLitt, Okay, I will just redo this in the next day or so. |
@RichardLitt okay I redid the revert in #3464. Note that your revert was fine, when I did it I got the same results. I just chose to resolve a conflict slightly differently. |
Thank you, @kevina! |
I think I did this incorrectly, but I am not sure. Why should a revert have merge conflicts? This is an attempt at fixing #3164.