Skip to content

postpone consumePurchase until after server-side purchases credit #2155

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hafizzle
Copy link
Contributor

  • In PurchaseHandler.handleError, remove automatic consumePurchase on any error to avoid burning tokens before gems arrive.
  • Only call consumePurchase() after the backend confirms gems have been credited.
  • Add retry logic around startListening/queryPurchases so any unconsumed purchases are picked up when the app launches.
  • Prevent lost purchases by ensuring the client only consumes tokens once we know the user got their gems.

(This change works in tandem with the backend fix that defers marking receipts consumed until after successful gem credit.)

- In PurchaseHandler.handleError, remove automatic consumePurchase on any error to avoid burning tokens before gems arrive.
- Only call consumePurchase() after the backend confirms gems have been credited.
- Add retry logic around startListening/queryPurchases so any unconsumed purchases are picked up when the app launches.
- Prevent lost purchases by ensuring the client only consumes tokens once we know the user got their gems.

(This change works in tandem with the backend fix that defers marking receipts consumed until after successful gem credit.)
@Hafizzle Hafizzle requested review from phillipthelen, saraolson and SabreCat and removed request for SabreCat June 18, 2025 17:43
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.

1 participant