-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use purchases.subscriptionsv2 for Android Feast subscriptions #1545
Use purchases.subscriptionsv2 for Android Feast subscriptions #1545
Conversation
ac2873c
to
795e9aa
Compare
795e9aa
to
1b0bc21
Compare
const promises = event.Records.map(async (sqsRecord: SQSRecord) => { | ||
try { | ||
const subscriptions = await fetchSubscriptionDetails(sqsRecord); // Subscription[] | ||
await Promise.all(subscriptions.map(sub => putSubscription(sub))); | ||
// TODO: parse this using zod to get validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO is for a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
What does this change?
Use the
purchases.subscriptionsv2
endpoint to retrieve data about Android Feast subs, instead ofpurchases.subscriptions
v1 (which we use for the live app).The reason for the migration is that when using the v1 endpoint, we rely on being able to map a product ID to a billing duration. This mapping is defined here:
mobile-purchases/typescript/src/services/productBillingPeriod.ts
Line 4 in bb1632e
Some back story on the v2 endpont: Tom Wadeson did some work to implement the v2 endpoint. In product there's a test which uses the v2 endpoint in parallel with the v1 endpoint for x% of requests to the subscriptions endpoint. There's a draft PR #1338 to use the new libs everywhere, but not merged yet. Using this for Feast feels like a nice step in the migration path as we're using it for real but in a focused context.
How to test
I've updated the Jest tests and tested in CODE (and can now see the billing duration being correctly set).
How can we measure success?
Have we considered potential risks?
Images
Accessibility