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 logout problem with multipe flightpath docking widget #2319

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

ReimarBauer
Copy link
Member

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:

@@ -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
Copy link
Member Author

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)
Copy link
Member Author

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

Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

a follow up: #2320

Copy link
Collaborator

@matrss matrss left a 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)
Copy link
Collaborator

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.

Comment on lines +440 to +442
def assert_attribute():
assert topview_0.window.testAttribute(QtCore.Qt.WA_DeleteOnClose)
qtbot.wait_until(assert_attribute)
Copy link
Collaborator

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.

Comment on lines +465 to +468
def assert_label_text():
# verify logged in
assert self.window.usernameLabel.text() == self.userdata[1]
qtbot.wait_until(assert_label_text)
Copy link
Collaborator

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.

@ReimarBauer ReimarBauer merged commit ba18d01 into Open-MSS:develop Apr 15, 2024
8 checks passed
@ReimarBauer ReimarBauer deleted the i2309b branch April 15, 2024 10:34
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.

multipe flightpath docking widget on logout traceback
2 participants