Commit Graph
13 Commits
Author SHA1 Message Date
NeilClack e7041894ba Merge pull request 'Fix network connection timeouts and security detection' (#59) from wifi-fix-06-28-2026 into dev
Reviewed-on: https://codeberg.org/RhemaWave-Technologies/RhemaWave/pulls/59
2026-06-28 02:04:52 -05:00
NeilClack 193ebbcb27 Fix network connection timeouts and security detection
- Fixed detectSecurity() where WPA2 (0x100/PSK) and WPA3 (0x400/SAE)
  flags were swapped, causing NM to reject connections silently
- Added missing AP path to AddAndActivateConnection call
- Added critical connection settings: UUID, interface-name,
  autoconnect, permissions
- Changed init() to fail fast with logger.Fatal instead of
  silent failure on NM connection error
- Added auth-alg and psk-flags to WPA/WPA2 security settings
2026-06-28 01:56:35 -05:00
NeilClack 3bcfce2617 use logger instead of printf 2026-06-27 17:06:14 -05:00
NeilClack 8567cd5bdb add extra case to waitForConnection 2026-06-27 17:04:34 -05:00
NeilClack 7e598f191f Update Network package 2026-06-27 16:01:33 -05:00
NeilClack fc5c1dfe6d Update network manager to utilize gonetworkmanager for an easier life... 2026-06-26 18:40:56 -05:00
NeilClack a4eff17b77 fix(network): fix wifi page never scanning, never exiting, and UI freezes on connect
WiFiSetupPage never showed networks and could not be exited once entered.
Several compounding bugs were responsible across network.go and page.go.

Primary bugs fixed:

- WiFiSetupPage.Init() never assigned p.wifiDevice after FindDevices(),
  so startScan() always hit the nil guard and exited without launching
  a scan goroutine. No networks ever appeared in the list. A value copy
  of the Wi-Fi device is now taken from m.Devices immediately after
  FindDevices() returns, with an explicit error if no adapter is found.

- CheckInternetConnection() called FindDevices() on every tick, rebuilding
  m.Devices every 2 seconds. This caused [NET-030] log spam, invalidated
  any pointers held into the slice, and meant checkState()'s fresh Manager
  instances (which have an empty Devices slice) would never detect internet
  after Fix 2 was applied. CheckInternetConnection() now calls FindDevices()
  only when m.Devices is empty (fresh Manager), and does a cheaper per-device
  State property refresh when devices are already known (long-lived Manager).
  This satisfies both callers correctly.

- Connect() called WaitForInternet(30s, 5s) synchronously before returning,
  blocking the main UI thread for up to 35 seconds. It also returned an error
  if internet wasn't stable in time, even though AddAndActivateConnection had
  succeeded, causing the page to show "Failed to initiate connection" while NM
  was still negotiating in the background. WaitForInternet removed from
  Connect(); the page's existing checkConnectionStatusLoop and
  handleConnectionStatusUpdate already handle post-connection state tracking.

Additional bugs fixed:

- startScan() launched a new StartScan goroutine on every R-press without
  signalling the previous one to stop. Concurrent goroutines raced on
  resultsChan and accumulated indefinitely. stopScan is now closed and
  replaced before each scan, and checkConnectionStatusLoop is restarted
  with the new channel.

- Connect() always generated a new UUID and called AddAndActivateConnection
  without checking for an existing profile. Repeated connection attempts
  (e.g. wrong password then correct) accumulated duplicate stale profiles
  in NetworkManager. Existing profiles matching the SSID are now deleted
  via Settings.Connection.Delete before creating a new one.

- m.Devices was read and written concurrently from StartScan and
  CheckInternetConnection goroutines without synchronisation. A sync.RWMutex
  is added to Manager; state refreshes take a write lock, StartScan device
  lookup takes a read lock.

- Connect() checked wifiDevice.State using the caller's value copy taken at
  Init() time, which never updated. The current state is now read from
  m.Devices under lock at the point of connection.

- auth-alg: "open" was unconditionally set in the 802-11-wireless-security
  settings block. This field is only meaningful for WPA/WPA2-Personal and
  should be omitted for SAE (WPA3) and EAP variants. It is now only set
  when KeyMgmt is "wpa-psk".
2026-06-24 22:41:48 -05:00
NeilClack a7f551ccca Add extensive logging to networking package 2026-06-24 21:32:14 -05:00
NeilClack 953d0d8bc9 Rewrite entire network package and update wifi page 2026-06-24 18:29:59 -05:00
NeilClack 26e84a4d23 Refactored the Networking package. D0.1B 2026-06-18 11:46:46 -05:00
NeilClack 5fef01107b Attempt to fix wifi connectivity 2026-03-13 20:58:28 -05:00
NeilClack 514bba69f5 Fix Network Manager handling 2026-03-13 20:41:24 -05:00
NeilClack 403ec4db89 Initial release: RadiantWave v1.0 2026-03-12 08:05:10 -05:00