passepartout-apple/Passepartout
Davide 21340e9f56
Rewrite AppContext event handlers (#839)
Loading remote profiles before local profiles may cause duplicated NE
managers. This happened because if local profiles are empty, any remote
profile is imported regardless of their former existence in the local
store. The importer just doesn't know.

Therefore, revisit the sequence of AppContext registrations:

- First off
- Skip Tunnel prepare() because NEProfileRepository.fetch() does it
already
- NE is both Tunnel and ProfileRepository, so calling tunnel.prepare()
loads local NE profiles twice
- onLaunch() - **run this once and before anything else**
  - Read local profiles
  - Reload in-app receipt
  - Observe in-app eligibility → Triggers onEligibleFeatures()
  - Observe profile save → Triggers onSaveProfile()
  - Fetch providers index
- onForeground()
  - Read local profiles
  - Read remote profiles, and toggle CloudKit sync based on eligibility
- onEligibleFeatures()
  - Read remote profiles, and toggle CloudKit sync based on eligibility
- onSaveProfile()
  - Reconnect if necessary
2024-11-10 17:51:28 +01:00
..
App Rewrite AppContext event handlers (#839) 2024-11-10 17:51:28 +01:00
Intents Fix extra team prefix in keychain group (#721) 2024-10-11 03:45:20 +02:00
Library Rewrite AppContext event handlers (#839) 2024-11-10 17:51:28 +01:00
LoginItem Show in Mac status bar plus Login Item (#773) 2024-10-29 11:40:11 +01:00
Shared Unrestrict some features in .beta (#840) 2024-11-10 16:53:01 +01:00
Tunnel Revisit in-app eligibility for iCloud sharing (#837) 2024-11-09 15:20:59 +01:00
Config.xcconfig Show in Mac status bar plus Login Item (#773) 2024-10-29 11:40:11 +01:00
Passepartout.xctestplan Fix previous PR 2024-11-03 13:47:48 +01:00