-
Notifications
You must be signed in to change notification settings - Fork 94
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 logout problem with multipe flightpath docking widget #2319
Conversation
@@ -201,9 +201,6 @@ def __init__(self, parent=None, mainwindow=None, model=None, _id=None, | |||
self.mainwindow_signal_permission_revoked = mainwindow.signal_permission_revoked | |||
self.mainwindow_signal_render_new_permission = mainwindow.signal_render_new_permission | |||
self.mainwindow_signal_activate_flighttrack = mainwindow.signal_activate_flighttrack | |||
self.mainwindow_signal_activate_operation = mainwindow.signal_activate_operation | |||
self.mainwindow_signal_login_mscolab = mainwindow.signal_login_mscolab | |||
self.mainwindow_signal_logout_mscolab = mainwindow.signal_logout_mscolab | |||
self.mainwindow_listFlightTracks = mainwindow.listFlightTracks |
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.
those lines were duplicated
@@ -362,7 +359,7 @@ def openTool(self, index): | |||
mscolab_server_url=self.mscolab_server_url, | |||
token=self.token) | |||
|
|||
self.mainwindow_signal_logout_mscolab.connect(lambda: self.signal_logout_mscolab.emit()) | |||
self.mainwindow_signal_logout_mscolab.connect(self.signal_logout_mscolab.emit) |
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.
as discussed in #2310 (commits) this was the culprit
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.
Could you please file an issue to change this type of lambda everywhere? I've seen it in other places as well and the construct is generally problematic.
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.
a follow up: #2320
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.
LGTM. I left some comments where it could be slightly improved, but nothing critical.
@@ -362,7 +359,7 @@ def openTool(self, index): | |||
mscolab_server_url=self.mscolab_server_url, | |||
token=self.token) | |||
|
|||
self.mainwindow_signal_logout_mscolab.connect(lambda: self.signal_logout_mscolab.emit()) | |||
self.mainwindow_signal_logout_mscolab.connect(self.signal_logout_mscolab.emit) |
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.
Could you please file an issue to change this type of lambda everywhere? I've seen it in other places as well and the construct is generally problematic.
def assert_attribute(): | ||
assert topview_0.window.testAttribute(QtCore.Qt.WA_DeleteOnClose) | ||
qtbot.wait_until(assert_attribute) |
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 am pretty sure that setAttribute is an immediate action that does not require this kind of wait, but I wouldn't know how to find out if this is definitely the case.
def assert_label_text(): | ||
# verify logged in | ||
assert self.window.usernameLabel.text() == self.userdata[1] | ||
qtbot.wait_until(assert_label_text) |
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.
The self._login
method is implemented in a way that the login should be finished by the time it returns (i.e. it does such a wait internally). That means this wait_until could be a plain assert, same with where it is used again further down. This only applies to the login though, not to the logout.
Purpose of PR?:
Fixes #2309
Does this PR introduce a breaking change?
If the changes in this PR are manually verified, list down the scenarios covered::
Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs
Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes
Checklist:
<type>: <subject>