Skip to content

Fix originalTransactionIdentifier to strip Google Play recurrence suffix - #454

Draft
claude[bot] wants to merge 7 commits into
developfrom
fix/original-transaction-id-suffix
Draft

claude[bot] wants to merge 7 commits into
developfrom
fix/original-transaction-id-suffix

Conversation

@claude

@claude claude Bot commented Aug 12, 2026

Copy link
Copy Markdown

Requested by Ian Rumac · Slack thread

Changes in this pull request

Before: StoreTransaction.originalTransactionIdentifier reported the current transaction's own Google Play order id. For subscription renewals Google Play appends a recurrence suffix to the order id (GPA.1234-1234-1234-12345..0, ..1, ..2, ...), so a renewal reported an id like GPA.1234-1234-1234-12345..2 as its "original" transaction id instead of the first period's id.

After: originalTransactionIdentifier reports the base order id (GPA.1234-1234-1234-12345) by stripping the trailing ..N recurrence suffix, matching how the server side already normalizes these ids. Fields that represent the current transaction (storeTransactionId, EntitlementTransaction.transactionId, the redeem request's orderId) are unchanged.

How: Added an internal GoogleBillingPurchaseTransaction.originalOrderId(orderId) helper that strips a trailing ..N (\.\.\d+$) and applied it at the two sites that map a Play order id into an original-transaction field: the Purchase constructor in GoogleBillingPurchaseTransaction.kt and the TransactionReceipt.originalTransactionId collection in ReceiptManager.kt. Unit tests in GoogleBillingPurchaseTransactionTest.kt cover no-suffix, ..0, ..1, multi-digit ..12, single-dot ids that must not be truncated, and null.

Checklist

  • All unit tests pass.
  • All UI tests pass.
  • Demo project builds and runs.
  • I added/updated tests or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.
  • I have run ktlint in the main directory and fixed any issues.
  • I have updated the SDK documentation as well as the online docs.
  • I have reviewed the contributing guide

Generated by Claude Code

claude and others added 7 commits August 12, 2026 18:14
Google Play appends a recurrence suffix (..N) to order ids for
subscription renewals, e.g. GPA.1234-1234-1234-12345..1. The original
transaction id was being reported as the renewal's own order id.
Strip the trailing ..N wherever an original transaction id is expected,
while keeping the untouched order id for current-transaction fields.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0144ioYUormc7wKAGwYVa2Dw
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0144ioYUormc7wKAGwYVa2Dw
Resolve conflict in generated coverage badge (.github/badges/jacoco.svg)
by taking develop's version; CI regenerates it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0144ioYUormc7wKAGwYVa2Dw
Resolve conflict in ReceiptManager.kt: develop moved loadPurchases onto the
neutral StorePurchase type (purchaseToken -> token). Keep the recurrence
suffix strip on the original transaction id against the new field:
GoogleBillingPurchaseTransaction.originalOrderId(purchase.orderId) ?: purchase.token

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0144ioYUormc7wKAGwYVa2Dw
Resolve coverage badge conflicts by taking develop's generated badges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0144ioYUormc7wKAGwYVa2Dw
@claude

claude Bot commented Nov 5, 2026

Copy link
Copy Markdown
Author

CI status on 3803111: all tests pass; the one red check is coverage-report, and it isn't this PR's code.

  • unit-tests first failed because the Gradle wrapper download from services.gradle.org timed out before anything compiled (another PR hit the same timeout that minute). Re-runs passed, as did all five instrumentation-tests shards.
  • coverage-report builds the report fine but fails at its "Commit coverage badge" step: GitHub rejects the bot's push to this branch with remote rejected ... (fatal error in commit_refs_rules). It failed the same way on two re-runs. The same bot push to this branch succeeded at 12:03Z today, so either a ruleset changed since then or it's a GitHub-side error. I can't read this repo's rulesets or branch protection from here (403), so someone with admin access would need to check, or re-run the job later.

Generated by Claude Code

This branch has not been deployed

No deployments
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