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

[SK2] send unsynced attributes when syncing purchases #4245

Merged
merged 5 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Sources/Purchasing/Purchases/PurchasesOrchestrator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,9 @@ private extension PurchasesOrchestrator {
self.backend.post(receipt: .empty,
productData: nil,
transactionData: .init(appUserID: currentAppUserID,
presentedOfferingContext: nil,
unsyncedAttributes: unsyncedAttributes,
storefront: await Storefront.currentStorefront,
Copy link
Member Author

Choose a reason for hiding this comment

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

we dont really need the storefront here I think since there are no purchases

Copy link
Member

Choose a reason for hiding this comment

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

nitpick: maybe it's worth splitting this into its own line, like we do in the else code path, that explicitly does createProductRequestData

Copy link
Contributor

Choose a reason for hiding this comment

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

@aboedo Done! We're now creating transactionData on it's own line 😎

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have any concerns about the additional await here adding extra time to this function? I feel like I recall awaiting on something SK2-related like this when doing network requests added latency in certain scenarios, but I can't recall exactly what it was off the top of my head right now.

Copy link
Member

Choose a reason for hiding this comment

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

we're already awaiting sk2 twice in this codepath already though, right? first verified transaction + app transaction jws?

source: .init(isRestore: isRestore,
initiationSource: initiationSource)),
observerMode: self.observerMode,
Expand Down