passepartout-apple/Passepartout/Library/Sources/CommonLibrary/Domain
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
..
AppError.swift Rewrite AppContext event handlers (#839) 2024-11-10 17:51:28 +01:00
AppPreference.swift Persist "Only favorites" toggle (#813) 2024-11-05 11:28:27 +01:00
BundleConfiguration+AppGroup.swift Refactor static functions/entities in Library (#679) 2024-10-04 09:58:42 +02:00
BundleConfiguration+Main.swift Refactor in-app entities for StoreKit/Kvitto integration (#820) 2024-11-06 13:20:12 +01:00
Constants.swift Revisit in-app eligibility for iCloud sharing (#837) 2024-11-09 15:20:59 +01:00
ProfileAttributes.swift Revisit in-app eligibility for iCloud sharing (#837) 2024-11-09 15:20:59 +01:00
ProviderFavoriteServers.swift Fine-tune profile management with additional attributes (#807) 2024-11-03 23:35:45 +01:00