-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add cleanup tor files button to tor network settings #1301
Conversation
I'm reviewing this now, @ManfredKarrer. |
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.
NACK. See comments for details. In short:
- A couple typos in user-facing messages that need to be fixed
- A couple style nits around ctor param stacking
I tested the new functionality and confirmed that it left my tor/hiddenservice
dir intact as expected.
As a more general note, it seems that we should have a dedicated Tor network
view, as opposed to this sort of overloaded use of a dialog. Not saying that needs to be fixed in order to merge this, just mentioning it. Perhaps you think the same, and this is just more expedient right now, I don't know.
Also, if people are having trouble connecting in the first place, and are never getting past the splash screen, how are they going to get to these network settings at all in order to delete the Tor directory? I must be missing something.
And another thing: I have no idea why deleting the files in this directory would make a difference at all. Based on your original comments in the description of this PR, it sounds like this change is all based on a pragmatic observation that when you delete this directory, everything seems to start working. Not particularly satisfying, but I can't really argue with it either. Would be great to know what is actually making a difference here though.
torNetworkSettingWindow.info=If Tor is blocked by your internet provider or in your country you can try to use Tor bridges.\n\ | ||
torNetworkSettingWindow.deleteFiles.header=Connection problems? | ||
torNetworkSettingWindow.deleteFiles.info=If you have repeated connection problems at start up, deleting outdated Tor files might help. To do that click the button below and restart afterwards. | ||
torNetworkSettingWindow.deleteFiles.button=Deleting outdated Tor files and shut down |
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.
s/Deleting/Delete/
torNetworkSettingWindow.deleteFiles.header=Connection problems? | ||
torNetworkSettingWindow.deleteFiles.info=If you have repeated connection problems at start up, deleting outdated Tor files might help. To do that click the button below and restart afterwards. | ||
torNetworkSettingWindow.deleteFiles.button=Deleting outdated Tor files and shut down | ||
torNetworkSettingWindow.deleteFiles.success=Deleting outdated Tor files wa successful. Please restart. |
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.
s/wa/was/
BisqEnvironment bisqEnvironment, | ||
TorNetworkSettingsWindow torNetworkSettingsWindow, | ||
Clock clock, | ||
BSFormatter formatter) { |
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.
I don't think we want to move to one-parameter per line parameter stacking like this. Creates a lot of vertical noise, and constructors with a zillion parameters are usually a signal of something needing to be refactored anyway. I'd prefer that we keep parameters aligned with the opening paren, but not stack one per line. Just go to the 120 margin, and create a new line as necessary.
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.
Re typos:
Fixed in next commit.
Re Popup:
The popup is used when Tor cannot start up after 4 minutes at splash screens. So that is a reason why a dedicated Tor view will not work here. It is also considered as "exceptional" screen which should not be needed for normal use case.
Re why it changes anything:
I agree it is not satisfying not knowing more details. Will be a task for our new P2P network dev. There are some consensus files which might get outdated. I just have seen it yesterday with a seed node which kept failing after repeated restarts and after deleting the Tor dir it was fine.
Re ctor params:
I personally prefer it for readability to have one per line if its more then 3 or 4 params...
But not super strong opinion here. we can discuss... I prefer to keep it atm as I usually use it that way in most of the newer code parts.
Re deleteDirectory:
Do you see any risks in that method?
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.
Makes sense, re popup. I didn't realize that before. Thanks.
On deleteDirectory
I didn't analyze it line by line, but gave it a good look and then tested it end-to-end on my machine. This is the only place it's used in the codebase, so I'd say the risk is contained for now. Would be good to have tests around it for sure, but I'm ok with it as-is now.
@@ -219,7 +219,7 @@ public MainViewModel(WalletsManager walletsManager, WalletsSetup walletsSetup, | |||
DaoManager daoManager, EncryptionService encryptionService, | |||
KeyRing keyRing, BisqEnvironment bisqEnvironment, FailedTradesManager failedTradesManager, | |||
ClosedTradableManager closedTradableManager, AccountAgeWitnessService accountAgeWitnessService, | |||
BSFormatter formatter) { | |||
TorNetworkSettingsWindow torNetworkSettingsWindow, BSFormatter formatter) { |
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 is a good example of adding a constructor parameter (see other comments)
public MainView(MainViewModel model, | ||
CachingViewLoader viewLoader, | ||
Navigation navigation, | ||
Transitions transitions, |
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.
Avoid one per line ctor parameter stacking (see other, more detailed comment)
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.
ACK.
BisqEnvironment bisqEnvironment, | ||
TorNetworkSettingsWindow torNetworkSettingsWindow, | ||
Clock clock, | ||
BSFormatter formatter) { |
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.
Makes sense, re popup. I didn't realize that before. Thanks.
On deleteDirectory
I didn't analyze it line by line, but gave it a good look and then tested it end-to-end on my machine. This is the only place it's used in the codebase, so I'd say the risk is contained for now. Would be good to have tests around it for sure, but I'm ok with it as-is now.
Update (by @cbeams):
This PR fixes #1300. The following is from @ManfredKarrer's original comment there:
@ManfredKarrer's original text in this PR:
Could you also review the deleteDirectory method in FileUtils. We have to be sure to not delete the hidden service folder. As far I tested it it worked...