Skip to content
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

Fix bug in AuthenticationDialog #463

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Jaywalker
Copy link

Specific bug is described here: https://dev.deluge-torrent.org/ticket/3643#ticket

The issue occured because the AuthenticationDialog was destroy()'d before the calls were made to get the text from their GTK.Entry()'s. It has been fixed by using the same method as AccountDialog and storing the information in an Account object prior to the destroy() call.

It may be worth considering giving the user an option to save/update the hostlist.conf file with the working credentials as well, but that would merit discussion and a separate PR. This PR simply fixes the problem and leaves existing logic flow in place.

Copy link
Member

@cas-- cas-- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, I imagine this will also affect PasswordDialog so would be useful to fix there too

Comment on lines +257 to +258
self.destroy()
self.deferred.callback(response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was copied from the other dialog but we can make use of super to call the parent class cleanup steps

Suggested change
self.destroy()
self.deferred.callback(response)
super()._on_response(widget, response)

@@ -316,7 +316,7 @@ def _on_connect_fail(self, reason, host_id, try_counter):

def dialog_finished(response_id):
if response_id == Gtk.ResponseType.OK:
self._connect(host_id, dialog.get_username(), dialog.get_password())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If AuthenticationDialog methods get_username and get_password are not usable then they should also be removed from the class.

@@ -23,6 +23,7 @@ Contributors (and Past Developers):
* Pedro Algarvio ('s0undt3ch') <[email protected]>
* Cristian Greco ('cgreco') <[email protected]>
* Chase Sterling ('gazpachoKing') <[email protected]>
* Justin Williams ('Jaywalker')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is really for authors of significant contributions to Deluge

Copy link
Contributor

@zakkarry zakkarry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two linting issues by the way, figured I'd point them out.

https://github.com/deluge-torrent/deluge/actions/runs/10640286820/job/29631116756

@@ -316,7 +316,7 @@ def _on_connect_fail(self, reason, host_id, try_counter):

def dialog_finished(response_id):
if response_id == Gtk.ResponseType.OK:
self._connect(host_id, dialog.get_username(), dialog.get_password())
self._connect(host_id, dialog.account.username, dialog.account.password)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self._connect(host_id, dialog.account.username, dialog.account.password)
self._connect(
host_id, dialog.account.username, dialog.account.password
)

self.account = Account(
self.username_entry.get_text(),
self.password_entry.get_text(),
"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"",
'',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants