Commit Graph

14 Commits

Author SHA1 Message Date
Davide De Rosa 66a04862f9
Override Mullvad password (#233)
Set "m" as per official documentation:

https://mullvad.net/en/help/installing-mullvad-iphone-and-ipad/
2022-10-15 16:44:48 +02:00
Davide De Rosa 5627e6c4a9
Address UI race conditions (#229)
* Make some managers concurrency-safe

- IntentsManager: @MainActor, non-shared, continuation

- SSIDReader: @MainActor, continuation

- Reviewer: main queue, non-shared

* Review wrong use of Concurrency framework

There were background thread calls e.g. in VPNToggle, because
ProfileManager was used inside a VPNManager async call.

Annotate @MainActor wherever a Task involves UI.

* Make main managers MainActor

* Apply MainActor to Mac menus

* [ci skip] Update CHANGELOG

* Set MainActor consistently on Mac menu view models
2022-10-13 08:53:50 +02:00
Davide De Rosa fb4d563804 Do not sort Core Data entities by UUID
Crash on compare.
2022-10-11 09:43:26 +02:00
Davide De Rosa 092d4f5de2 Drop return in one-line functions 2022-09-04 20:30:55 +02:00
Davide De Rosa 4c4b3ee0c9 Revert to concrete-only managers
Abstraction was overcomplicated. Strategy pattern is enough.
2022-09-03 12:47:40 +02:00
Davide De Rosa 1c64253a1f Fix inverted profile lastUpdate logic
- Least recent was set last in the headers dictionary, thus
overwriting most recent (ascending = false)

- Mapping full profiles directly to array was generating
duplicates, use a dictionary to keep ID unicity
2022-08-04 23:36:09 +02:00
Davide De Rosa b183dece8c Fix logic to activate first created profile
Broken in dec7fb9030

VPN was lost when app was sent to background. Current (and active)
profile was persisted with nil isActive and instead of ignoring
profile activation, isActive was falling back to
allHeaders.isEmpty (false), erroneously deactivating the profile
and disconnecting the VPN.
2022-08-04 23:33:17 +02:00
Davide De Rosa dec7fb9030 Activate first created profile 2022-07-16 17:39:42 +02:00
Davide De Rosa 58e375ec41 Attach @MainActor where needed
Some methods were updating UI from non-main thread.
2022-07-16 17:39:42 +02:00
Davide De Rosa 7d5f3e63c8 Add 'didUpdate' subjects in managers
objectWillChange may not work outside SwiftUI.

- ProfileManager.didUpdateProfiles

- ProviderManager.didUpdateProviders
2022-07-15 08:59:29 +02:00
Davide De Rosa 7771b50b56 Add ProfileManager methods to return full profiles 2022-07-14 17:07:30 +02:00
Davide De Rosa 9d9dc2b2f6 Rename activeProfileId publisher for consistency 2022-07-14 17:07:30 +02:00
Davide De Rosa cbf00cef73 Fix Core Data fault due to missing headers lastUpdate 2022-07-14 17:07:30 +02:00
Davide De Rosa 9a8477225e Refactor library into domain + impl 2022-06-23 23:31:01 +02:00