ManagerDeviceList: Guard double-click against duplicate operations#3205
Open
gfrmin wants to merge 3 commits into
Open
ManagerDeviceList: Guard double-click against duplicate operations#3205gfrmin wants to merge 3 commits into
gfrmin wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
infirit
requested changes
Apr 18, 2026
|
|
||
| if event.type == Gdk.EventType._2BUTTON_PRESS and cast(Gdk.EventButton, event).button == 1: | ||
| if self.menu.show_generic_connect_calc(row["device"]['UUIDs']): | ||
| if self.menu.get_op(row["device"]): |
Contributor
There was a problem hiding this comment.
We can check this as soon as we have a valid row so please move this to earlier in the function. This will most likely also make SonarCloud happy.
Hoist the in-progress operation check out of the nested double-click branch to right after self.menu is ensured. Besides addressing review feedback and flattening one level of nesting (so SonarCloud is happy about maintainability), the guard now also covers the right-click popup path, which should not appear mid-operation either. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cognitive complexity of _on_event_clicked is one point over SonarCloud's threshold; the else-branch after the posdata guard return is the obvious redundancy. Equivalent behavior, one less complexity point. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



A quick second double-click on a device row while a connect/disconnect is still in flight currently fires a second
connect_service/disconnect_servicecall. This can lead to duplicate BlueZ requests and confusing UI state.Check
menu.get_op(device)before initiating, and skip if an operation is already tracked for that device.