Commit Graph

2989 Commits

Author SHA1 Message Date
Davide 0bff571d14
Polish TV profile view (#908)
- Layout with some profile details
- Add colors with adjusted brightness
- Add iOS/macOS instructions
- Add pending/sleeping markers
- Add previews
2024-11-22 02:20:41 +01:00
Davide 2636711e16
Do not disconnect active profile on remote import (#907)
Update library for this fix.
2024-11-22 01:15:51 +01:00
Davide 14398f5f20
Fix shared profile not updated on provider server selection (#906)
First, rename `force` parameter of ProfileManager.save() to `isLocal`,
because it's meant to be used when saving local profiles. In such
scenario, a profile that is also remotely shared _must_ be re-saved to
the remote repository.

This was not being done when selecting a provider server, and it could
be noticed because the other devices would only receive the iCloud
update after editing the profile and re-doing a manual "Save". Only at
that point would the new profile be re-shared on iCloud.
2024-11-22 00:46:58 +01:00
Davide b0c98ed27a
Lint XCTFail() 2024-11-21 23:01:08 +01:00
Davide 3d2a543a54
Fetch products from scratch each time (#905)
Do not risk getting products that may have been removed from sale.
2024-11-21 22:58:24 +01:00
Davide c5bdb9e363
Group IAP extensions into ad-hoc folder 2024-11-21 19:44:37 +01:00
Davide 5bec574841
Test MigrationManager (#904)
Decouple importer from ProfileManager.
2024-11-21 19:44:20 +01:00
Davide d74c94c125
Fix missing betaChecker arg in IAPManager 2024-11-21 19:10:36 +01:00
Davide 842375ffce
Test IAPManager (#903)
Refactoring:

- Split tests
- Report purchase to receipt reader (real impl does nothing)
- Abstract BetaChecker from now TestFlightChecker

Bugfixing:

- Fix duplicated code in fetchLevelIfNeeded()
- Fix observeObjects() missing .didUpdate publisher
2024-11-21 18:57:32 +01:00
Davide 2478fb204b
Test ExtendedTunnel (#902)
Decouple .connectionStatus to TunnelStatus.withEnvironment() for easy
testing.
2024-11-21 16:48:12 +01:00
Davide a93fcd4c66
Test ProfileManager (#901)
With some housekeeping.

Bugfixing:

- Do NOT skip empty remote profiles, allow removal when mirroring
- Look up profile in all profiles, not just filtered
- Posptone non-included profile removal

Refactoring:

- Rename ProfileProcessor to InAppProcessor
- Provides ProfileProcessor + TunnelProcessor protocols
- willSave -> willRebuild (because not always called on save)
- Notify ProfileManager import events
2024-11-21 16:03:57 +01:00
Davide c7cef70eed
Move IAP extensions to CommonLibrary
Leave CommonIAP agnostic of business models.
2024-11-21 12:09:06 +01:00
Davide 4466616339
Fix compile errors from #900 2024-11-21 10:47:46 +01:00
Davide b45f9c23fe
Rearrange targets for unit testing (#900)
- Move and rename entities
- Split protocols and default extensions
- Move in-app entities to CommonIAP target
2024-11-20 18:05:47 +01:00
Davide 2ccd3052ac
Log verification failure in tunnel 2024-11-19 22:46:18 +01:00
Davide 74ed93a966
Check provider requirements before connecting (#896)
E.g. interactive login must be presented afterwards.
2024-11-19 20:51:55 +01:00
Davide d8545a01b4
Update profiles requirements on new in-app receipt (#895)
Required features were only updated when reloading the local profiles,
but they may also change on in-app events due to changes in eligibility.
2024-11-19 19:44:31 +01:00
Davide 9528cecc27
Verify profile before presenting interactive login (#893)
If the profile is ineligible for features other than .interactiveLogin,
the interactive prompt would still be presented, but the user would hit
the paywall right afterwards.
2024-11-19 11:46:42 +01:00
Davide 35c10309a7
Reload receipt on purchase (#892)
StoreKit ProductView performs the purchases internally without calling
IAPManager.purchase(), which causes the IAPManager state to be
momentarily outdated.

Leverage PaywallView.onComplete() to reload the receipt and eventually
trigger IAPManager.objectWillChange, so that the app is immediately
unlocked on a successful purchase.
2024-11-19 11:36:36 +01:00
Davide bac1d494a4
Upscale upgrade icon only on macOS 2024-11-19 11:18:00 +01:00
Davide d78456bb90
Show upgrade icon in profiles list (#891)
Visually clarify that a profile requires a purchase to be enabled.

- Implement AppFeatureRequiring in Profile
- Refactor IAPManager.verify() accordingly
- Pre-compute required features in ProfileManager via ProfileProcessor
2024-11-19 08:55:41 +01:00
Davide 1536551922
Prepare WireGuard for provider selector (#890)
- Omit configuration on creation to show provider selector
- Take out ConfigurationView like OpenVPN
2024-11-18 17:49:47 +01:00
Davide 89d7af4df7
Rethink eligibility checks (#889)
- Allow unrestricted save, but show PurchaseRequiredButton
- Warn however about paid features (FIXME)
- Redesign features in paywall
- Strip already eligible features from paywall
- List required features in restricted alert
- Localize feature descriptions
- Review propagation of paywall modifiers/reasons

Extra:

- Move more domain entities from UILibrary to CommonLibrary
- Default on-demand policy to .any (free feature)
- Fix modals not reappearing after closing with gesture
- Extend UILibrary start-up assertions
2024-11-18 17:43:01 +01:00
Davide e82dac3152
Clear previous remote import task (#888)
Previous task was never nil-ed out on completion.
2024-11-18 10:56:54 +01:00
Davide a3dad4e445
Observe tunnel in grid/list
Can notice in Simulator not updating installed profile.

Regression from #843
2024-11-18 09:10:15 +01:00
Davide db592944ec
Rename module builders as functions 2024-11-17 22:30:22 +01:00
Davide 8e7f3e80ce
Update library with provider in modules (#887)
Move provider metadata from profile to module.
2024-11-17 22:27:02 +01:00
Davide 20813ac77e
Parametrize app name in strings 2024-11-17 18:48:40 +01:00
Davide 00ba67f135
Refactor buttons/menus
- Add divider in add profile menu
- Reuse trailing dots
2024-11-17 18:45:04 +01:00
Davide 839530e192
Bump version 2024-11-17 18:22:43 +01:00
Davide e58726d0af
Do not discard migrated profiles in TestFlight (#886)
Users would lose those profiles on downgrade to v2.
2024-11-17 18:21:37 +01:00
Davide 12b1784ac2
Bump version 2024-11-17 16:41:47 +01:00
Davide a2f17cc905
Use long dash for excluded migration profiles 2024-11-17 16:26:22 +01:00
Davide 01e0559060
Fix some minor bugs
- Observe profiles on Simulator
- Dismiss on error when fetching migratable profiles
- Improve migration logs ambiguity
2024-11-17 15:47:19 +01:00
Davide c93a43702c
Improve migrate design (#885)
- Mention iCloud in informational message
- Redesign to always show message despite no migratable profiles
- Refine the looks
2024-11-17 14:02:40 +01:00
Davide 1ddea2ad5e
Bump version 2024-11-17 11:42:28 +01:00
Davide 22e8e659e4
Discard old profiles once migrated (#884)
Otherwise, they would reappear if the migrated profiles are deleted from
the new store.
2024-11-17 11:40:49 +01:00
Davide d3e344670b
Resolve excessive profile reloads (#883)
Optimize ProfileManager in several ways:

- Refine control over objectWillChange
- Observe search separately
- Store subscriptions separately (local, remote, search)
- Fix multiple local updates on save/remove/foreground (updating
allProfiles manually)
- Update the library with more optimized NE reloads
- Cancel pending remote import before a new one
- Yield 100ms between imports
- Reorganize code

Extras:

- Only use background context in provider repositories
- Externalize tunnel receipt URL, do not hardcode BundleConfiguration
- Improve some logging

Self-reminder: NEVER use a Core Data background context to observe
changes in CloudKit containers. They just won't be notified (e.g. in
NSFetchedResultsController).

Fixes #857
2024-11-17 11:34:43 +01:00
Davide 9e5beff23a
Perform migrate + import in one step (#882)
- Drop the .importing / .imported steps
- Animate rows re-sorting during process
- Rephrase some strings better
- Test fake migration with launch argument
2024-11-16 21:16:25 +01:00
Davide 83eb02aa9d
Bump version 2024-11-16 15:14:37 +01:00
Davide afa22719bf
Improve migrate header on iOS (#881)
Refactor into more subviews.
2024-11-16 15:07:47 +01:00
Davide 589f2f62e0
Revert "Modernize check for TestFlight build" (#880)
Reverts passepartoutvpn/passepartout#875
2024-11-16 13:54:11 +01:00
Davide d724ad22d8
Bump version 2024-11-16 12:33:33 +01:00
Davide 3737560851
Add the option to migrate old profiles (#879)
Finalize migration flow:

- Add entry to "Add" menu
- Suggest to migrate old profiles when there are no profiles
- Add informational message
- Keep included profiles on top
- Allow deletion of migratable profiles
- Fix duplicated Form in preview
- Rename views and models

Improve some Theme modifiers:

- Empty message with full screen option
- Progress modifier with custom view
- Confirmation dialog with custom message
2024-11-16 12:29:03 +01:00
Davide 9ca103e949
Refactor modal size to be a modifer parameter (#877)
Way more flexible.
2024-11-15 23:32:54 +01:00
Davide b08243949c
Nested ZStack modifiers in progress/empty modifiers (#876)
Merge into a single modifier because they are used together.
2024-11-15 16:33:26 +01:00
Davide 55bb2e79c9
Modernize check for TestFlight build (#875)
Closes #874
2024-11-15 15:34:47 +01:00
Davide 09e894dd60
Add explicit environment objects to TableColumn (#873)
For some reason, Table doesn't seem to inherit the environment in some
cases. Reapply environment to each TableColumn (only Theme is required).

Work around what clearly seems to be a SwiftUI bug.

Fixes #872
2024-11-15 01:47:52 +01:00
Davide 962ffdf678
Sort servers by .serverId in repository 2024-11-15 00:24:36 +01:00
Davide 6472ac0502
Revert "Sort provider servers on iOS"
This reverts commit 2b3961aef0.
2024-11-15 00:22:06 +01:00