For rotateLogsIfNeeded and clearLogs so that isReady is marked as false
in case calling FileManager.default.createFile returns nil; on exception,
isReady is set to false and fileHandle is set to nil so that log creation doesn't
fail silently.
File names were added to constants in GlobalConstants
Attempts to use applicationSupportDirectory as fallback if app group is not available;
Then documentDirectory, and finally, temporaryDirectory as last resort
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)