[FINAL] CI Integration#1
Merged
Merged
Conversation
This was referenced Jun 9, 2026
This was referenced Jun 22, 2026
vegaro
pushed a commit
that referenced
this pull request
Jun 23, 2026
### Motivation Follow-up test coverage for #3603. That PR's refactor commit (`b2bfd86`) fixed a bug where `workflowId`/`stepId` were `@Transient` on the cached transaction metadata and were lost on the disk round-trip, so `presented_workflow_id` / `presented_step_id` would be sent as `null` on retry or unsynced replay. The field was promoted to a first-class `workflowMetadata` on `LocalTransactionMetadata` with `@SerialName("workflow_metadata")`, but there was no regression test asserting it actually survives serialization. ### What this adds One test in `LocalTransactionMetadataStoreTest`, `cacheLocalTransactionMetadata round-trips workflow metadata`, mirroring the existing `handles paywall data` test. The JSON written to `SharedPreferences` is captured and fed back to `getLocalTransactionMetadata`, so the real `JsonTools.json` encode/decode runs (only SharedPreferences I/O is mocked). ### Verification (RED → GREEN) - **RED**: with `workflowMetadata` marked `@Transient`, the test fails at the assertion (`retrieved?.workflowMetadata` is `null`). - **GREEN**: with `@SerialName("workflow_metadata")` (current state), it passes. Ran `:purchases:testDefaultsBc8DebugUnitTest --tests "...LocalTransactionMetadataStoreTest"` locally (JDK 21). Companion to #3636 (which covers the `PostReceiptHelper` threading and replay paths). Together they close the two test gaps identified in review of #3603. <details> <summary>AI session context</summary> **Task:** Review #3603 ("is anything missing?"), then close the identified test gaps. **Findings from review of #3603:** 1. (important) Disk round-trip of `workflowMetadata` untested, the exact bug `b2bfd86` fixed. `LocalTransactionMetadataStoreTest` had the analogous `handles paywall data` round-trip test but nothing for `workflowMetadata`. 2. (important) `PostReceiptHelper` threading untested (only an `any()` count bumped). → covered by #3636. **This PR** addresses finding #1. **Decisions:** - Reused the existing capture-the-written-JSON pattern so the test exercises real serialization, not a mock, which is what makes it a genuine guard for the `@Transient` regression. - Based on `cesar/receipt-presented-paywall-workflow-ids` because the `workflowMetadata` field only exists there, not on `main`. **Verified:** RED→GREEN as described above. Production code (`LocalTransactionMetadata.kt`) left unchanged; only the test file is added. **Not done:** The remaining review items on #3603 were questions, not test gaps (all-or-nothing `WorkflowMetadata.from`, impression/purchase step-id divergence under dedup, `pr:other` vs `pr:fix` label). Not addressed here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) </details> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
No description provided.