Repository navigation
Serialize Apple recovery submissions per subscription - #1445
Merged
Merged
Conversation
Recovery submitted distinct transaction IDs in parallel. Billing commits only the latest concurrent confirmation of a subscription, so renewals sharing an original transaction could fail each other as retryable 503s. Submit each subscription's transactions one at a time, while unrelated subscriptions stay independent. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Maple development preview: https://bae0d542.maple-ca8.pages.dev Commit: Uses development API, billing, flags and PCR configuration. Cloudflare Access applies. |
This branch was successfully deployed
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.
Summary
Apple transaction recovery submitted distinct transaction IDs in parallel, and only revisions of the same ID were serialized. Renewals of one subscription have different IDs, so they raced. Billing only commits the latest concurrent confirmation of a subscription, so the others came back as retryable 503s. If the latest one also failed, the whole batch failed.
StoreKitRecoverynow submits transactions that share anoriginalTransactionIdone at a time. A failed submission doesn't stop the next one, disposal stops anything still queued, and different subscriptions stay independent. Each submission is still bounded by the existing 30-second request timeout, so a stuck request can only delay its own subscription briefly.Test change
submits newer revisions after an older failure...used anothertransaction that inherited the sameoriginalTransactionId, though it meant to be unrelated. It now has its own, matchinga pending transaction does not block a different transaction ID.Validation
just lane research-web, the only lane selected, passed.Not exercised: the iOS app, a real StoreKit queue, or a linked billing backend. Already installed app versions keep the old behavior until they update.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.