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

The second and subsequent purchases did not go well and were not reflected on the dashboard #556

Open
11 tasks done
Terurinpic opened this issue Dec 22, 2022 · 21 comments
Open
11 tasks done
Labels
bug Something isn't working

Comments

@Terurinpic
Copy link

Terurinpic commented Dec 22, 2022

‼️ Required data ‼️

Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!

Environment

  • Output of flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.4, on macOS 13.0 22A380 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.73.0)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!
  • Version of purchases-flutter
    • 4.5.4
  • Testing device version e.g.: iOS 15.5, Android API 30, etc.
    • iOS 16.0.3
  • How often the issue occurs- every one of your customers is impacted? Only in dev?
    • Only ios16 or higher
    • Often happens on second purchase
  • Debug logs that reproduce the issue
    • first purchase(working fine)
[Purchases] - WARN: 🍎⚠️ StoreKit 2 purchase took longer than expected (30.57 seconds)
[Purchases] - DEBUG: ℹ️ Force refreshing the receipt to get latest transactions from Apple.
[Purchases] - DEBUG: ℹ️ SKReceiptRefreshRequest started
[Purchases] - WARN: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.
[Purchases] - DEBUG: ℹ️ Vending CustomerInfo from cache.
[Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Started
[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings
[Purchases] - DEBUG: ℹ️ API request completed: GET /v1/subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings (200)
[Purchases] - DEBUG: ℹ️ Skipping products request for these products because they were already cached: ["dev.gera.fan.premium_ticket.1", "dev.gera.fan.premium_ticket.3", "dev.gera.fan.premium_ticket.30.free.20", "dev.gera.fan.premium_ticket.20.free.12", "dev.gera.fan.premium_ticket.10.free.5", "dev.gera.fan.premium_ticket.50.free.50", "dev.gera.fan.premium_ticket.5.free.2", "gera_dev_099_test"]
[Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Finished
[Purchases] - DEBUG: ℹ️ Serial request done: GET subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings, 0 requests left in the queue
[Purchases] - DEBUG: ℹ️ SKReceiptRefreshRequest finished
[Purchases] - DEBUG: ℹ️ Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/D7D69861-EF24-45E9-B889-D4311FA5F728/StoreKit/sandboxReceipt
[Purchases] - DEBUG: ℹ️ Skipping products request for these products because they were already cached: ["dev.gera.fan.premium_ticket.1"]
[Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: DXtY6V9dOmTieLJwo1fPBXC0EHD2
[Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Started
[Purchases] - INFO: ℹ️ Receipt parsed successfully
[Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Posting receipt (note: the contents might not be up-to-date, but it will be refreshed with Apple's servers):
{
  "opaque_value" : "siIZ1WcLpkVQACSIVatZlw==",
  "original_application_version" : "1.0",
  "bundle_id" : "fan.gera.dev",
  "sha1_hash" : "LnbWuFETws5mGv3ThsmyjegSsfA=",
  "application_version" : "827",
  "creation_date" : "2022-12-22T03:56:49Z",
  "in_app_purchases" : [
    {
      "product_id" : "dev.gera.fan.premium_ticket.1",
      "quantity" : 1,
      "transaction_id" : "2000000234083525",
      "is_in_trial_period" : false,
      "web_order_line_item_id" : 0,
      "original_purchase_date" : "2022-12-22T03:56:43Z",
      "original_transaction_id" : "2000000234083525",
      "product_type" : 1,
      "purchase_date" : "2022-12-22T03:56:43Z"
    }
  ]
}
[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request POST receipts
[Purchases] - DEBUG: ℹ️ API request started: POST /v1/receipts
[Purchases] - DEBUG: ℹ️ API request completed: POST /v1/receipts (200)
[Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Finished
[Purchases] - DEBUG: ℹ️ Serial request done: POST receipts, 0 requests left in the queue
[Purchases] - DEBUG: ℹ️ Sending updated CustomerInfo to delegate.
[Purchases] - INFO: 💰 Finishing transaction '2000000234083525' for product 'dev.gera.fan.premium_ticket.1'
[Purchases] - INFO: 😻💰 Purchased product - 'dev.gera.fan.premium_ticket.1'
  • second purchase(there's problem)
[Purchases] - WARN: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.
[Purchases] - DEBUG: ℹ️ Vending CustomerInfo from cache.
[Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Started
[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings
[Purchases] - DEBUG: ℹ️ API request completed: GET /v1/subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings (200)
[Purchases] - DEBUG: ℹ️ Skipping products request for these products because they were already cached: ["dev.gera.fan.premium_ticket.10.free.5", "dev.gera.fan.premium_ticket.30.free.20", "dev.gera.fan.premium_ticket.20.free.12", "gera_dev_099_test", "dev.gera.fan.premium_ticket.50.free.50", "dev.gera.fan.premium_ticket.5.free.2", "dev.gera.fan.premium_ticket.1", "dev.gera.fan.premium_ticket.3"]
[Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Finished
[Purchases] - DEBUG: ℹ️ Serial request done: GET subscribers/DXtY6V9dOmTieLJwo1fPBXC0EHD2/offerings, 0 requests left in the queue
<SKReceiptRefreshRequest: 0x280852340>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=603 "Request throttled" UserInfo={NSLocalizedDescription=Request throttled, NSLocalizedFailureReason=Unified receipt is valid and current}
[Purchases] - DEBUG: ℹ️ SKReceiptRefreshRequest finished
[Purchases] - DEBUG: ℹ️ Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/D7D69861-EF24-45E9-B889-D4311FA5F728/StoreKit/sandboxReceipt
[Purchases] - DEBUG: ℹ️ Skipping products request for these products because they were already cached: ["dev.gera.fan.premium_ticket.1"]
[Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: DXtY6V9dOmTieLJwo1fPBXC0EHD2
[Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Started
[Purchases] - INFO: ℹ️ Receipt parsed successfully
[Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Posting receipt (note: the contents might not be up-to-date, but it will be refreshed with Apple's servers):
{
  "opaque_value" : "siIZ1WcLpkVQACSIVatZlw==",
  "original_application_version" : "1.0",
  "bundle_id" : "fan.gera.dev",
  "sha1_hash" : "LnbWuFETws5mGv3ThsmyjegSsfA=",
  "application_version" : "827",
  "creation_date" : "2022-12-22T03:56:49Z",
  "in_app_purchases" : [
    {
      "product_id" : "dev.gera.fan.premium_ticket.1",
      "quantity" : 1,
      "transaction_id" : "2000000234083525",
      "is_in_trial_period" : false,
      "web_order_line_item_id" : 0,
      "original_purchase_date" : "2022-12-22T03:56:43Z",
      "original_transaction_id" : "2000000234083525",
      "product_type" : 1,
      "purchase_date" : "2022-12-22T03:56:43Z"
    }
  ]
}
[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request POST receipts
[Purchases] - DEBUG: ℹ️ API request started: POST /v1/receipts
[Purchases] - DEBUG: ℹ️ API request completed: POST /v1/receipts (200)
[Purchases] - DEBUG: ℹ️ PostReceiptDataOperation: Finished
[Purchases] - DEBUG: ℹ️ Serial request done: POST receipts, 0 requests left in the queue
[Purchases] - INFO: 💰 Finishing transaction '2000000234084002' for product 'dev.gera.fan.premium_ticket.1'
[Purchases] - INFO: 😻💰 Purchased product - 'dev.gera.fan.premium_ticket.1'
  • Steps to reproduce, with a description of expected vs. actual behavior
    Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Describe the bug

I want to make the second and subsequent purchases successful.
However, after the second purchase, the following error occurs and the purchase is not reflected on the dashboard.

<SKReceiptRefreshRequest: 0x28250fb40>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=603 "Request throttled" UserInfo={NSLocalizedDescription=Request throttled, NSLocalizedFailureReason=Unified receipt is valid and current}

Additional context

it's working on Android and iOS15

Thank you.

@Terurinpic Terurinpic added the bug Something isn't working label Dec 22, 2022
@RCGitBot
Copy link
Contributor

RCGitBot commented Dec 22, 2022

👀 SDKONCALL-194 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@michaelAtRC
Copy link

Is this happening in sandbox? If so, this is likely happening because the user has many purchases in their receipt, which is common in sandbox. You can try making a new sandbox user. Currently our mobile engineers are working on updating the SDK to handle this sandbox case better, but you likely won't see this happen in production.

If this is in production, please let me know!

@aboedo
Copy link
Member

aboedo commented Dec 28, 2022

@Terurinpic it seems like this ticket is a duplicate of #557, would you mind if we close this one out and continue conversation there?

@Terurinpic
Copy link
Author

@michaelAtRC
it's happening in sandbox.
Create a new account and check it out!

@aboedo
This issue cannot purchase the same product. (error dialog is not displayed)
But #557 shows an error dialog when purchasing different products.
So I think it's another issue.

@michaelAtRC
Copy link

Hey @Terurinpic Happy new year!

Quick question, did creating a new sandbox user and purchasing show you the same problem? Or did it resolve this issue?

@Terurinpic
Copy link
Author

Hello @michaelAtRC Happy New Year to you too!

I tried it, but i have the same problem.

@michaelAtRC
Copy link

Hey @Terurinpic

I have gone ahead and raised this issue to the TRIAGE team. I will keep you updated as I get more information!

@aboedo
Copy link
Member

aboedo commented Jan 11, 2023

The logs show that the request to refresh the receipt was throttled. That seems to be a new thing in StoreKit, since we only started seeing it like a month or two ago.
We recently made updates to try to prevent that, but those updates should be a part of 4.5.4, so perhaps that wasn't enough 😬
cc @NachoSoto

@aboedo
Copy link
Member

aboedo commented Jan 12, 2023

@Terurinpic question that might be helpful for us when debugging, are these consumables or non-consumables?

@Terurinpic
Copy link
Author

Terurinpic commented Jan 12, 2023

@aboedo consumables!

@aboedo
Copy link
Member

aboedo commented Jan 12, 2023

Thanks for the quick turnaround! We're investigating the issue. It seems likely that it's related to the throttling of the refresh receipt request

@aboedo
Copy link
Member

aboedo commented Jan 16, 2023

@Terurinpic does this reproduce consistently for you? I see a number of purchases for that user in the purchase history for dev.gera.fan.premium_ticket.1, are you checking the "show sandbox data" checkbox?

@Terurinpic
Copy link
Author

@aboedo
Reproduce consistently!
After launching the app, the first purchase is reflected in the dashboard, but the second purchase is not reflected.
I checked "show sandbox data".

@aboedo
Copy link
Member

aboedo commented Jan 17, 2023

@Terurinpic do they show in the SDK in customerInfo under nonSubscriptionTransactions?

@aboedo
Copy link
Member

aboedo commented Jan 17, 2023

I can't seem to reproduce 😬 I just tried buying the same consumable multiple times in the same session I can see all purchases in the dashboard in sandbox data

@Terurinpic
Copy link
Author

Terurinpic commented Jan 18, 2023

@aboedo
It seems that the second purchase is not displayed in nonSubscriptionTransactions.(The first purchase is shown.)
Oh no...
Is there anything that I can do?

@michaelAtRC
Copy link

Hey @Terurinpic could we get appUserIDs that reproduce this and gather logs for it? I tried looking up the appUserID in the logs but it’s already been cycled out.

@Terurinpic
Copy link
Author

@michaelAtRC
Should I send the my AppUserId to the URL below?
the support section of the Dashboard

@michaelAtRC
Copy link

Hey @Terurinpic That would be great to create a new support ticket!

@Terurinpic
Copy link
Author

@michaelAtRC
I sent my AppUserId now!

@Terurinpic
Copy link
Author

Hey @michaelAtRC @aboedo
The project I'm working on didn't have an app-specific shared secret, so I set it up and now it works! (same #557)
Thanks for investigating!
RC is a great service!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants