Repository navigation
Conversation
Windows knows two things the engine cannot work out for itself: NCSI's connectivity level for the current network, and the moment an address or a route moves. Both are platform signals, so they belong in the platform. - The Wi-Fi query asks WinRT for the connectivity level of the internet profile, and only a WLAN profile counts: on a docked machine the internet profile is Ethernet, and its level says nothing about the Wi-Fi. - A move into ConstrainedInternetAccess is reported as the new WifiEvent.Changed, which the engine handles exactly as it handles WifiEvent.Available: the same probe, the same campus-SSID and Pronto gate, the same auto-login setting. - The Wi-Fi loop wakes on iphlpapi's NotifyAddrChange instead of only on its timer. The notification is asynchronous and cancellable, so nothing keeps firing after the app stops listening. This replaces #197, which added a second connectivity state machine next to the engine.
This branch has not been deployed
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.
Replaces #197 — that PR added a second Windows-only connectivity state machine next to
LatchEngine. This one keeps the two pieces that were worth keeping (NCSI's connectivity level, event-driven address-change detection) and feeds them to the shared engine.What changed
Windows tells the engine when a captive portal appears (
WindowsWifiPlatform)NetworkInformation.GetInternetConnectionProfile()):None,LocalAccess,ConstrainedInternetAccess,InternetAccess.ConstrainedInternetAccess, the platform emits the newWifiEvent.Changed. The engine handles it exactly as it handlesWifiEvent.Available: the same probe, the same campus-SSID and Pronto gate, the sameautoLoginsetting. Nothing about the credential path changes.The Wi-Fi loop wakes on the OS instead of only on its timer (
WindowsIpChangeNotifier)iphlpapi'sNotifyAddrChangeis registered asynchronously with anOVERLAPPEDof our own, so it can be given back withCancelIPChangeNotifywhen the app stops. A blocking call cannot be cancelled and keeps triggering checks afterstop().The shared engine (
LatchEngine)WifiEvent.Changed→ re-check. No new states, no second coordinator, no second login path.What is deliberately not here
WindowsHostelConnectivityMonitor/HostelAuthenticator/HostelConnectivityStateand theCaptivePortalDetectorrewrite from [Windows]: Implement automatic hostel Wi-Fi authentication and connectivity recovery #197. They duplicated the engine's recovery and login logic, ignoredautoLoginand the latch state, could deadlock on the non-reentrant mutex, and would have dropped the Pronto gate ([Fix]: Send portal credentials only when the portal points at Pronto #210) and the Base64 Wi-Fi fields ([Fix]: Keep Windows Wi-Fi names from shifting other fields #223).DEGRADEDtracking from [Windows]: Implement automatic hostel Wi-Fi authentication and connectivity recovery #197: nothing consumes it yet.Verification
./gradlew :core:desktopTest— green, including the new tests./gradlew :desktop:compileKotlinDesktop :cli:build :cli:test :desktop:smoke— green./gradlew assembleDebug testDebugUnitTest :app:lintDebug— greenNeeds a run on Windows
The native path and the WinRT query only exist on Windows, and CI here is Linux, so this still needs a run on a real Windows machine: the NCSI level, the
NotifyAddrChangewake-up, and theChangedevent reaching the engine.