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 Core Implementation #1144

Merged
merged 7 commits into from
Jan 10, 2025

Conversation

aataraxiaa
Copy link
Contributor

@aataraxiaa aataraxiaa commented Jan 2, 2025

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/0/1208767141940868/f
iOS PR: Privacy Pro Free Trials Core Implementation
macOS PR: Privacy Pro Free Trials Core Implementation (BSK Bump Only, No macOS Impacts)
What kind of version bump will this require?: Minor
Tech Design URL: https://app.asana.com/0/1206488453854252/1208916720468103/f

Description: This PR adds additional changes to support Privacy Pro Free Trials on iOS, specifically:

  1. Update Subscription completion/confirm API to enable passing of additional params to the /confirm backend API
  2. Updates the Subscription offer model
  3. Adds Production Free Trial products and logic to filter Free Trial products based on offer availability AND product ID (this is needed as a product might be intended for Free Trial, but might not have an offer due to it expiring, e.g outside it's availability dates)
  4. Minor additional changes

Steps to test this PR:

  1. Green CI
  2. See test steps on linked iOS PR

Internal references:

Software Engineering Expectations
Technical Design Template

@aataraxiaa aataraxiaa force-pushed the pete/pp-free-trials-core-implementation branch from d734685 to b37b625 Compare January 2, 2025 13:13
@aataraxiaa aataraxiaa marked this pull request as ready for review January 2, 2025 15:03
@aataraxiaa aataraxiaa requested a review from miasma13 January 2, 2025 15:46
@miasma13
Copy link
Contributor

@federicocappelli, looping you in to be aware of these incoming changes

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.

Just a cosmetic comment, other than that all looks solid.

Comment on lines 23 to 26
enum StoreSubscriptionConstants {
/// The suffix appended to subscription identifiers to indicate that the subscription includes a free trial.
static let freeTrialSuffix = ".freetrial"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor comment to that:

  1. I would drop the . from the value as it is semantic connector for identifier
  2. It is called a suffix but technically not used as one:
  • in l:56-57 .dev is appended
  • elsewhere is checked with id.contains(StoreSubscriptionConstants.freeTrialSuffix)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, thanks @miasma13. Have updated based on feedback.

Comment on lines 56 to 57
"ios.subscription.1month\(StoreSubscriptionConstants.freeTrialSuffix).dev",
"ios.subscription.1year\(StoreSubscriptionConstants.freeTrialSuffix).dev"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the .dev part? Couldn't we reuse the original names and append it with suffix? The multitude of subscriptions is not helpful so sticking to some consistency can be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Chatted with @miasma13 on MM). The staging subscriptions here are not ideally named. However, as the production subs too follow convention, we are ok with leaving this for now.

@aataraxiaa aataraxiaa force-pushed the pete/pp-free-trials-core-implementation branch from 9bac893 to b02485c Compare January 10, 2025 10:59
@aataraxiaa aataraxiaa merged commit 1700c54 into main Jan 10, 2025
7 checks passed
@aataraxiaa aataraxiaa deleted the pete/pp-free-trials-core-implementation branch January 10, 2025 11:05
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