Fix iOS 26.4+ restore: defer handleRestore to allow pending transactions to arrive#286
Merged
Merged
Conversation
… arrive On iOS 26.4+, restoreCompletedTransactionsFinished may be called before all restored transactions are delivered via updatedTransactions. This caused handleRestore to be called with an empty array. Fix by deferring the handleRestore delivery using a 500ms timer, giving pending updatedTransactions callbacks time to process restored transactions first. Agent-Logs-Url: https://github.com/libgdx/gdx-pay/sessions/9dc875b1-3666-46a7-a485-0946d118e71b Co-authored-by: keesvandieren <863966+keesvandieren@users.noreply.github.com>
Agent-Logs-Url: https://github.com/libgdx/gdx-pay/sessions/9dc875b1-3666-46a7-a485-0946d118e71b Co-authored-by: keesvandieren <863966+keesvandieren@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix iOS restorePurchases to handle transactions correctly
Fix iOS 26.4+ restore: defer handleRestore to allow pending transactions to arrive
Apr 13, 2026
Member
|
@copilot why did you prefer the iOS specifc timer over Mobivms standard Java timer as specified in #285 (comment)? (I don't care too much about which one, except that the one in #285 (comment) looks a bit cleaner) |
Replaces the iOS-specific NSTimer (which didn't compile) with com.badlogic.gdx.utils.Timer, matching the approach suggested in issue #285. Agent-Logs-Url: https://github.com/libgdx/gdx-pay/sessions/042d60fa-727f-43f6-bef1-8e8002016b3b Co-authored-by: keesvandieren <863966+keesvandieren@users.noreply.github.com>
Contributor
Author
Switched to libGDX's Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On iOS 26.4+,
restoreCompletedTransactionsFinishedfires beforeupdatedTransactionsdelivers the restored transactions (~60ms gap observed), causinghandleRestoreto always receive an empty array. Only affects StoreKit 1 (PurchaseManageriOSApple); StoreKit 2 uses sequential async iteration and is unaffected.Changes
handleRestorecall inrestoreCompletedTransactionsFinishedwith a 500ms libGDXTimer.schedule(), allowing pendingupdatedTransactionscallbacks to populaterestoredTransactionsfirstdispose(),purchaseRestore(), andrestoreCompletedTransactionsFailed()to prevent leaks and stale deliveriesNote: Build cannot be verified in CI due to sandbox network restrictions (Android Gradle Plugin resolution fails). The change is limited to a single file.