passepartout-apple/Passepartout/Library/Sources
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
..
AppData In-place NetworkExtension profiles (#715) 2024-10-10 16:03:02 +02:00
AppDataProfiles Rewrite AppContext event handlers (#839) 2024-11-10 17:51:28 +01:00
AppDataProviders Refactor library targets (#799) 2024-11-02 10:11:59 +01:00
AppUI Refactor library targets (#799) 2024-11-02 10:11:59 +01:00
AppUIMain Add more view modifiers (#838) 2024-11-10 12:00:07 +01:00
AppUITV Add more view modifiers (#838) 2024-11-10 12:00:07 +01:00
CommonAPI Refactor library targets (#799) 2024-11-02 10:11:59 +01:00
CommonLibrary Rewrite AppContext event handlers (#839) 2024-11-10 17:51:28 +01:00
CommonUtils Rewrite AppContext event handlers (#839) 2024-11-10 17:51:28 +01:00
LegacyV2 Refactor in-app entities for StoreKit/Kvitto integration (#820) 2024-11-06 13:20:12 +01:00
PassepartoutImplementations Decouple library from PassepartoutKit implementations (#834) 2024-11-08 12:37:09 +01:00
UILibrary Rewrite AppContext event handlers (#839) 2024-11-10 17:51:28 +01:00