Skip to content

fix: handle connectivity errors and Bluetooth power state - #18

Merged
ry2x merged 1 commit into
mainfrom
fix/connectivity-error
Sep 3, 2026
Merged

ry2x merged 1 commit into
mainfrom
fix/connectivity-error

Conversation

@ry2x

@ry2x ry2x commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Prevent Bluetooth discovery when the adapter is unavailable or powered off.
  • Synchronize discovery with Bluetooth power and page activity changes.
  • Distinguish Wi-Fi authentication failures from other connection failures.
  • Only prompt for credentials when a password-protected network fails authentication.

Copilot AI lite review requested due to automatic review settings September 3, 2026 13:02
@ry2x
ry2x merged commit 297931a into main Sep 3, 2026
1 check passed
@ry2x
ry2x deleted the fix/connectivity-error branch September 3, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The updated Wi‑Fi state-changed handler no longer handles NM.DeviceState.NEED_AUTH, which can leave pending connections uncleared and suppress credential retry prompts in common “missing secrets” scenarios.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves connectivity UX by gating Bluetooth discovery on adapter/power availability and by making Wi‑Fi connection errors more specific, especially around authentication failures.

Changes:

  • Wi‑Fi: classifies NetworkManager device failure reasons to only prompt for credentials on likely authentication failures.
  • Bluetooth: prevents discovery when powered off and synchronizes discovery with both page activity and Bluetooth power state.
File summaries
File Description
src/stores/connectivity/wifiPage.ts Adds authentication-failure classification to decide when to prompt for Wi‑Fi credentials after connection failures.
src/stores/connectivity/bluetooth.ts Prevents discovery when Bluetooth is off and keeps discovery state in sync with page activity and power changes.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +204 to +217
if (state === NM.DeviceState.ACTIVATED) {
pendingAccessPoint = null;
} else if (state === NM.DeviceState.FAILED) {
pendingAccessPoint = null;
if (pending.requires_password && isAuthenticationFailure(reason)) {
retryAccessPoint = pending;
setError(
`Could not connect to ${pending.ssid || 'this network'}. Enter the password and retry.`
);
} else {
retryAccessPoint = null;
setError(`Could not connect to ${pending.ssid || 'this network'}.`);
}
}
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.

2 participants