Skip to content

Improve connection reliability: logging, timeouts, and error handling#3194

Closed
gfrmin wants to merge 1 commit into
blueman-project:mainfrom
gfrmin:reliability-fixes
Closed

Improve connection reliability: logging, timeouts, and error handling#3194
gfrmin wants to merge 1 commit into
blueman-project:mainfrom
gfrmin:reliability-fixes

Conversation

@gfrmin
Copy link
Copy Markdown

@gfrmin gfrmin commented Mar 31, 2026

Summary

  • AutoConnect logging: AutoConnect.err() silently discarded failures with pass. Now logs warnings so users/devs can see why auto-connect failed.
  • D-Bus timeout: Replaced timeout=GLib.MAXINT with 45s on ConnectService/DisconnectService calls. Prevents indefinite UI freeze when BlueZ hangs (related: blueman-manager 2.4.1 freezes on Debian 13 #2927).
  • Double-click guard: Double-clicking a device while a connect/disconnect operation is already in progress no longer starts a duplicate operation.
  • Operation auto-clear: Stuck operations in ManagerDeviceMenu.__ops__ are now auto-cleared after 60 seconds, preventing the permanent "Connecting..." state.
  • Robust parse_dbus_error: Added ValueError handling for malformed D-Bus error messages that don't contain the expected colon-separated format.

Note on related PRs

This PR intentionally does not touch the error message mapping in _handle_error_message / _BLUEZ_ERROR_MAP, as that area is being improved by #3120 and #2556.

Test plan

  • Verify AutoConnect failures appear in log output
  • Verify connect/disconnect operations time out after ~45s instead of hanging forever
  • Verify double-clicking a device during an active operation does not start a second one
  • Verify stuck "Connecting..." state auto-clears after 60s
  • Verify malformed D-Bus errors don't crash the error handler
  • python -m py_compile passes on all 4 modified files
  • Existing test suite passes (8/9 unrelated to changes)

🤖 Generated with Claude Code

- Log AutoConnect failures instead of silently swallowing them
- Replace GLib.MAXINT D-Bus timeout with 45s to prevent UI freeze
- Guard double-click connect against duplicate operations
- Add 60s auto-clear for stuck operations in ManagerDeviceMenu
- Handle malformed error messages in parse_dbus_error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@gfrmin gfrmin closed this Mar 31, 2026
@gfrmin gfrmin deleted the reliability-fixes branch March 31, 2026 17:07
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.

1 participant