* Remove setting of statusDetailsValid to false on handleServerChanged()
This variable is used to show the splash screen until the app successfully starts polling,
then it's set to true and and it's never set to false again afterwards.
* Change DispatchQueue.global usage for Task.detached to stop network extension
Gets rid of warning: Main actor-isolated property 'networkExtensionAdapter'
can not be referenced from a Sendable closure.
The ViewModel class is marked @MainActor, which means networkExtensionAdapter
is isolated to the main actor. Accessing it from a DispatchQueue.global closure
(which runs on a background thread) violates Swift's actor isolation rules.
* Manually stop and start polling when navigating to and from ServerView
Choosing to Change Server creates a dialog that when clicked on the Confirm
button, it stops the client connection. This is handled via the handleServerChanged method.
When app starts, though, it polls in a loop for the current state of the connection via startPollingDetails.
It is overwriting the states manually assigned inside handleServerChanged.
This commit manually turns off the polling when handleServerChanged is called, and turns it back on
after user navigates away from ServerView.
Message:
When switching between wifi and cellular, the Go engine fires rapid state
changes (connecting → disconnecting → connected) that confused the UI
animation state machine, causing it to get stuck in "Connecting..." state.
Changes:
- Add isRestarting flag to suppress intermediate state updates during restart
- Add recovery path in playDisconnectingLoop when engine reconnects
- Add status polling guard to prevent concurrent fetchData calls
- Add AppLogger for unified Swift logging to shared container
- Update share logs to export both engine and app log files
* Add some tests calling sdk method to set environment variable
* Add GlobalConstants and EnvVarPackager
* Add EnvList as parameter to NetBirdSDKClient.run method
* Add option to toggle force relay connection to AdvancedView
MainViewModel code is stil WIP
* Add usage of appGroup when using shared UserDefaults
* Use the defined App Group identifier for userPreferencesSuiteName
* Add ForceRelayAlert to be displayed when user toggles the option in AdvancedView
* Extract code that grays out background when an Alert is displayed in AdvancedView to a common function
* Remove prints
* Replace @StateObject with @EnvironmentObject property wrapper for viewModel in Alerts
Their parent view (AdvancedView) also accesses it via @EnvironmentObject property
* Replace force unwrap with flatMap
* Add default value for keyForceRelayConnection when reading from defaults
If the key isn't set, it will use the value by default
* Update forceRelayConnection property with the provided value when setForcedRelayConnection is called
* Remove redundant parameter for LogLevelAlert
* Add default value usage for keyForceRelayConnection in MainViewModel
* Wrap onConnected()'s self.completionHandler(nil) call with DispatchQueue.main.async
So that the call happens in the main thread to correctly handle UI state update (Connecting... -> Connected)
* Add NetBird logo to Use NetBird Server button
* Add plus and minus icons
* Add ServerViewModel
* Refactor ServerView to modularize view creation
Still WIP
* Change project file to include new ViewModel
* Add ServerView button actions
* Add Extensions for View and function to hide keyboard
* Add server field error text
* Hide keyboard on button / screen tap
* Make sdk calls non-blocking
* Add URL and setupKey validation on ServerViewModel
* Add enable/disable UI flow
* Use Task.detached on serverView to not lock main thread when calling SDK methods
* Clear SSO not supported message on server textEdit change
* Consolidate error messages and flags
* Change ServerViewErrors to a class/ObservableObject to make SwiftUI detect changes
* Add better exception handling
* Clear setup key field error when toggling Add this device...
* Block Add device toggle when UI is disabled
* Add JustifiedText View implementation to justify text
* Set height on JustifiedText as optional
Add early return if view width calculation isn't ready
* Remove redundant guard
* Rename closure parameter
Also add ViewModel environment object to #Preview
* Replace usage of Color(red: 0, green: 0, blue: 0, opacity: 0) with Color.clear
* Add user input sanitization
* Add tap gesture to dismiss keyboard when tapping outside of an input field
* Bump version to 0.0.13.4
* Add ellipsis animation to Validating text when UI is blocked
* Bump version to 0.0.13.5