Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privacy Pro Free Trials - Models and API #1120

Merged
merged 7 commits into from
Dec 11, 2024

Conversation

aataraxiaa
Copy link
Contributor

@aataraxiaa aataraxiaa commented Dec 6, 2024

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/1208114992212396/1208796999534221/f
iOS PR: duckduckgo/iOS#3691
macOS PR: duckduckgo/macos-browser#3641
What kind of version bump will this require?: Minor

Optional:

Tech Design URL: https://app.asana.com/0/481882893211075/1208773437150501/f

Description: This PR includes the following:

  • Adds a new model type for Subscription Offers
  • Adds a new API to StorePurchaseManager to retrieve Free Trial Subscriptions
  • Updates existing subscriptionOptions API to NOT return Free Trial Subscriptions
  • Adds abstractions on StoreKit types to enable testing
  • Adds tests (Note: Make sure to expand the StorePurchaseManagerTests file when reviewing)

Steps to test this PR:

  1. Green CI here, and also see client PRs

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@aataraxiaa aataraxiaa self-assigned this Dec 6, 2024
@aataraxiaa aataraxiaa marked this pull request as ready for review December 6, 2024 16:04
@aataraxiaa aataraxiaa requested a review from miasma13 December 6, 2024 16:05
@@ -34,10 +34,157 @@ public enum StorePurchaseManagerError: Error {
case unknownError
}

/// A protocol that defines the properties of an introductory offer for a subscription product.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this file gets a bit bloated and may be a bit hard to wrap your head around, what do you think about making a StorePurchaseManager subfolder and split out the protocols, extensions etc. to separate files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion @miasma13, I'll make that change.

Copy link
Contributor

@miasma13 miasma13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the PR looks great, the changes you made are explicit and retain the current flows unaffected. The defined protocols make sense and provide good abstraction over the StoreKit provided types. Big kudos for the docs.

@aataraxiaa aataraxiaa merged commit e8654e1 into main Dec 11, 2024
7 checks passed
@aataraxiaa aataraxiaa deleted the pete/pp-free-trials-offer-models branch December 11, 2024 15:32
aataraxiaa added a commit to duckduckgo/macos-browser that referenced this pull request Dec 11, 2024
Task/Issue URL:
https://app.asana.com/0/1208114992212396/1208796999534221/f
Tech Design URL:
https://app.asana.com/0/481882893211075/1208773437150501/f

**Description**: Includes the following changes:
* Bumps BSK which includes changes [here].
(duckduckgo/BrowserServicesKit#1120)
* Also forces casts `SubscriptionProduct` type to `Product` type, but
only in debug menu code
aataraxiaa added a commit to duckduckgo/iOS that referenced this pull request Dec 11, 2024
samsymons added a commit that referenced this pull request Dec 19, 2024
* main: (24 commits)
  change api (#1133)
  Ensure authToken is present before calling refreshAuthTokenIfNeeded
  Add 'locale' to report broken site params
  Add 'locale' to report broken site params
  Ensure authToken is present before calling refreshAuthTokenIfNeeded
  Privacy Pro Free Trials - Models and API (#1120)
  remove MaliciousSiteProtectionSubfeature (#1131)
  Malware protection 6: Malware integration (#1099)
  Add underlying error to PrivacyStatsError (#1130)
  Initial changes for compilation time tracking. (#1111)
  iOS System level credential provider (#1127)
  Increase ratio of complete form saves (#1124)
  Add PrivacyStatsError.failedToClearPrivacyStats (#1128)
  Update autofill to 16.0.0 (#1122)
  Update local network routing (#1117)
  Update RMF version matching to ignore build number (#1118)
  Fix threading issue between using a Semaphore and async/await (#1115)
  add experiment test fake feature (#1119)
  Bump Tests/BrowserServicesKitTests/Resources/privacy-reference-tests from `a603ff9` to `6133e7d` (#1109)
  experiment default metrics pixels (#1107)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants